Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ansible-language-server for yaml #7973

Merged
merged 2 commits into from
Oct 8, 2023
Merged

Add ansible-language-server for yaml #7973

merged 2 commits into from
Oct 8, 2023

Conversation

lwandrebeck
Copy link
Contributor

Add ansible support to yaml.
If this PR is accepted, I’ll update wiki accordingly.

Add ansible support to yaml.
Copy link
Member

@the-mikedavis the-mikedavis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can fix the CI by running cargo xtask docgen and commiting the changes

@the-mikedavis the-mikedavis changed the title Update languages.toml Add ansible-language-server for yaml Aug 19, 2023
@the-mikedavis the-mikedavis added S-waiting-on-review Status: Awaiting review from a maintainer. A-language-support Area: Support for programming/text languages labels Aug 19, 2023
@x70b1
Copy link

x70b1 commented Oct 7, 2023

@the-mikedavis how can we get a 2nd approval here? It seems like this is the only thing thats missing here.

@pascalkuthe pascalkuthe merged commit bdf7937 into helix-editor:master Oct 8, 2023
6 checks passed
@lwandrebeck lwandrebeck deleted the ansible branch October 8, 2023 10:45
@RachaelMDavies
Copy link

Ansible language server does not appear to work, can someone confirm it does for them? Helix just says "language server exited". I am using the latest Helix master with this commit and also have yaml language server installed.

2023-10-10T12:55:36.289 helix_term::application [WARN] Ignoring a client/registerCapability request because dynamic capability registration is not enabled. Please report this upstream to the language server
2023-10-10T12:55:36.342 helix_term::application [ERROR] Language Server: Method window/showMessageRequest not found in request 3
2023-10-10T12:55:36.346 helix_lsp::transport [ERROR] ansible-language-server err <- "/usr/local/lib/node_modules/@ansible/ansible-language-server/node_modules/vscode-jsonrpc/lib/common/connection.js:565\n"
2023-10-10T12:55:36.346 helix_lsp::transport [ERROR] ansible-language-server err <- "                        responsePromise.reject(new messages_1.ResponseError(error.code, error.message, error.data));\n"
2023-10-10T12:55:36.346 helix_lsp::transport [ERROR] ansible-language-server err <- "                                               ^\n"
2023-10-10T12:55:36.346 helix_lsp::transport [ERROR] ansible-language-server err <- "\n"
2023-10-10T12:55:36.346 helix_lsp::transport [ERROR] ansible-language-server err <- "ResponseError: Method not found: window/showMessageRequest\n"
2023-10-10T12:55:36.346 helix_lsp::transport [ERROR] ansible-language-server err <- "    at handleResponse (/usr/local/lib/node_modules/@ansible/ansible-language-server/node_modules/vscode-jsonrpc/lib/common/connection.js:565:48)\n"
2023-10-10T12:55:36.346 helix_lsp::transport [ERROR] ansible-language-server err <- "    at handleMessage (/usr/local/lib/node_modules/@ansible/ansible-language-server/node_modules/vscode-jsonrpc/lib/common/connection.js:345:13)\n"
2023-10-10T12:55:36.346 helix_lsp::transport [ERROR] ansible-language-server err <- "    at processMessageQueue (/usr/local/lib/node_modules/@ansible/ansible-language-server/node_modules/vscode-jsonrpc/lib/common/connection.js:362:17)\n"
2023-10-10T12:55:36.346 helix_lsp::transport [ERROR] ansible-language-server err <- "    at Immediate.<anonymous> (/usr/local/lib/node_modules/@ansible/ansible-language-server/node_modules/vscode-jsonrpc/lib/common/connection.js:334:13)\n"
2023-10-10T12:55:36.346 helix_lsp::transport [ERROR] ansible-language-server err <- "    at process.processImmediate (node:internal/timers:471:21) {\n"
2023-10-10T12:55:36.346 helix_lsp::transport [ERROR] ansible-language-server err <- "  code: -32601,\n"
2023-10-10T12:55:36.346 helix_lsp::transport [ERROR] ansible-language-server err <- "  data: undefined\n"
2023-10-10T12:55:36.346 helix_lsp::transport [ERROR] ansible-language-server err <- "}\n"
2023-10-10T12:55:36.346 helix_lsp::transport [ERROR] ansible-language-server err <- "\n"
2023-10-10T12:55:36.346 helix_lsp::transport [ERROR] ansible-language-server err <- "Node.js v18.13.0\n"
2023-10-10T12:55:36.354 helix_lsp::transport [ERROR] ansible-language-server err: <- StreamClosed
2023-10-10T12:55:36.621 helix_term::application [WARN] Ignoring a client/registerCapability request because dynamic capability registration is not enabled. Please report this upstream to the language server
$ ansible-language-server --version
1.2.1

@pascalkuthe
Copy link
Member

This is a bug in the a able language server (as the logs say). Maybe it works with newer versions

@RachaelMDavies
Copy link

@pascalkuthe I am using the latest version. @lwandrebeck It works for you? If so, which version?

It should not be a default if it does not work!

@lwandrebeck
Copy link
Contributor Author

Works fine here on Rocky 9 with:
ansible-language-server --version
1.2.1
hx --version
helix 23.05 (13e7eda)
node --version
node v16.20.1

Hope that helps

@RachaelMDavies
Copy link

@lwandrebeck Would you be able to build the latest Helix from Master and try again? I am thinking it is most likely that something has changed in Helix, namely the registerCapability request feature.

I am running Debian 12, the only real difference between Debian and Rocky for this case might be the version of NodeJS used.

@the-mikedavis
Copy link
Member

I can reproduce locally with node 18.18.0. It looks like an upstream problem where ansible-language-server doesn't handle the failed promise when it sends the window/showMessageRequest. That promise fails because we don't implement that method and (correctly) send back the MethodNotFound JSONRPC reply. The unhandled failed promise is probably benign on node 16 but fatal on node 18. I can reproduce on Helix 23.05 and master as long as ansible-language-server is running on node 18.

@lwandrebeck
Copy link
Contributor Author

lwandrebeck commented Oct 11, 2023

image
Updated to helix 23.05 (1852292) (on another box though, Ubuntu 22.04, Node 18.18.0 and using Rust 1.73.0 just because)
Got the same error with Node 16.20.2 and 16.20.1 though. This is with a WIP yaml file.
But, opening a known working and properly formatted ansible playbook yaml file does work without problems and offers completion.
I’ll try to dig deeper when time permits.

@lwandrebeck
Copy link
Contributor Author

A quick update. I’ve written most of the past day yaml files, and ansible completion worked flawlessly. I did not encounter the error above anymore, even with WIP files. There’s something fishy somewhere…

@David-Else
Copy link
Contributor

I have filed an issue based on what @the-mikedavis reported above. If I made a mistake please can someone let me know and I will edit it.

@lwandrebeck Please keep looking for the fishy behaviour, I am sure we can get this sorted :)

@lwandrebeck
Copy link
Contributor Author

I’ve done here and there some more ansible without problems. So I’m afraid I can’t help much on that point. Something new on your side ?

@David-Else
Copy link
Contributor

David-Else commented Oct 24, 2023

They added my bug report to a list of things they will deal with 'in the next year', so other than that nothing. I don't use it much so am just going to forget about the problem and hope it is fixed eventually.

danillos pushed a commit to danillos/helix that referenced this pull request Nov 21, 2023
* Update languages.toml

Add ansible support to yaml.

* cargo xtask docgen
dgkf pushed a commit to dgkf/helix that referenced this pull request Jan 30, 2024
* Update languages.toml

Add ansible support to yaml.

* cargo xtask docgen
mtoohey31 pushed a commit to mtoohey31/helix that referenced this pull request Jun 2, 2024
* Update languages.toml

Add ansible support to yaml.

* cargo xtask docgen
smortime pushed a commit to smortime/helix that referenced this pull request Jul 10, 2024
* Update languages.toml

Add ansible support to yaml.

* cargo xtask docgen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-language-support Area: Support for programming/text languages S-waiting-on-review Status: Awaiting review from a maintainer.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants