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

LSP: No-op client/registerCapability requests #6258

Merged
merged 1 commit into from
Mar 13, 2023

Conversation

the-mikedavis
Copy link
Member

Some language servers send this request even though we don't enable dynamic capability registration. In some language servers that use the vscode-languageserver-node dependency, replying with an error can cause the server to exit because an un-caught rejected promise is fatal.

Replying with a JSONRPC error that the method is not handled is the correct thing to do but given that it causes some language servers in the wild to exit and that ignoring it doesn't cause any harm, we can workaround the exits by just sending an OK and doing nothing. This is similar to a workaround done by neovim.

Recent examples: #6230, #6243

@the-mikedavis the-mikedavis added C-enhancement Category: Improvements E-easy Call for participation: Experience needed to fix: Easy / not much A-language-server Area: Language server client S-waiting-on-review Status: Awaiting review from a maintainer. labels Mar 10, 2023
Some language servers send this request even though we don't enable
dynamic capability registration. In some language servers that use the
vscode-languageserver-node dependency, replying with an error can cause
the server to exit because an un-caught rejected promise is fatal.

Replying with a JSONRPC error that the method is not handled is the
correct thing to do but given that it causes some language servers in
the wild to exit and that ignoring it doesn't cause any harm, we can
workaround the exits by just sending an OK and doing nothing. This is
similar to a workaround done by neovim.
@archseer archseer merged commit 4f066b1 into master Mar 13, 2023
@archseer archseer deleted the workaround-register-capability branch March 13, 2023 00:29
sagnibak pushed a commit to sagnibak/helix that referenced this pull request Mar 21, 2023
wes-adams pushed a commit to wes-adams/helix that referenced this pull request Jul 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-language-server Area: Language server client C-enhancement Category: Improvements E-easy Call for participation: Experience needed to fix: Easy / not much S-waiting-on-review Status: Awaiting review from a maintainer.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants