-
Notifications
You must be signed in to change notification settings - Fork 2.3k
feat(gh_actions_ls): add vim.lsp.config
support
#3713
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
Conversation
Nice, thanks! So we can cross this from #3705 |
Just a headsup, this LSP config did not work for me until I also added the following to the config:
Maybe that needs to be documented? Also, diagnostic error messages don't show up, but maybe there's something broken in my setup, though this only occurs for this particular LSP as far as I can see. |
@gstokkink That's weird, when I tested it earlier, it seemed to work. But I can confirm I now also get the error, and diagnostics not showing up anymore. I am not sure what causes this behavior though, |
yes. and I don't see how does the old config still work? maybe something changes in the LS. |
Weird thing is that sometimes the diagnostics do show up, but I haven't yet figured out what causes this erratic behaviour. Maybe some caching issue? |
Reminds me of neovim/neovim#32247 Maybe neovim/neovim#33391 (comment) provides a hint that could be used here? |
Alright, fixed it. I had to set 'event' to |
A small update to the docstring would be welcome |
Aside from the session-token issue, the LS still attaches to some yaml files it's not supposed to attach. I am very sorry, I assume I messed up my testing of the change by somehow still running |
Yeah, I noticed it attaching to other YAML files as well. Not sure how this can happen, are the root markers not being evaluated correctly? |
Look at the old config, and figure out how to make it work with the new one. |
Yeah that one is due to the |
@chrisgrieser thanks! I've resorted to using the |
see #3713 (comment) (Note that `workspace_required` requires nightly or the upcoming nvim 0.11.1)
The issue is not so much the Here they access |
@gstokkink @jhoogstraat |
1. Replace `root_markers` and `workspace_required = true` with a `root_dir` function that checks the file is located in the correct location. This prevents some edge cases where the LSP would still attach to non-workflow files. This also makes unnecessary to use a `yaml.github` filetype, [as the readme of the lsp describes](https://github.com/lttb/gh-actions-language-server?tab=readme-ov-file#add-yamlgithub-filetype-detection). 2. add an empty `init_options` table, since such a table is apparently needed by the LSP: #3713 (comment)
gh_actions_ls
is missing in thelsp
folder, likely due to it using a workaround with single file support to prevent it from attaching to every yaml file, even though it should only attach to certain yaml files, without defining an extrayaml.github
filetype (see #3558).Using
.github/workflows
and co asroot_markers
however prevents this issue, allowing us to use the LSP like a regular LSP without it attaching to unrelated yaml files. Thus, there is no problem anymore usinggit_actions_ls
withvim.lsp.config
.cc @disrupted