LanguageClient-neovim
LanguageClient-neovim copied to clipboard
Don't send textDocument/didSave unless server advertises support for it
More information: dart-lang/sdk#36464 natebosch/vim-lsc#164 tomv564/LSP#550
I use the follow config
let g:LanguageClient_serverCommands = {
\ 'python' :["pyls"],
\ 'rust': ['rustup', 'run', 'stable', 'rls'],
\ 'dart': ['$DART_SDK/dart', "$DART_SDK/snapshots/analysis_server.dart.snapshot", "--lsp"],
\ }
while I try to save a dart file, I get a error
[LC] [Error] Unknown method textDocument/didSave%
Is there a way to disable this for a given language explicitly in LanguageClient configuration? reading docs did not yield any useful information on this matter.
Cheers
Not yet. It should be fairly simple to implement though so if someone is willing to open a PR I would be happy to help and merge. Otherwise I should be able to have a commit ready for this in a few days.
Does anyone have an example of a server that does not advertise support for this? I have something ready-ish but would like to try it out first before pushing any changes.
@martskins dart server has this issue, once you installed dart you can run it with dart "$DART_SDK/bin/snapshots/analysis_server.dart.snapshot" --lsp
. LC config:
let g:LanguageClient_serverCommands = {
\ 'dart': ['dart', $DART_SDK.'/bin/snapshots/analysis_server.dart.snapshot', '--lsp'],
\ }
Opened #1188 to fix this. It will only send the notification if the server advertised support for it. I tried it with dart and it seemed to work, but if someone else can give that PR a try that would be great.
Merged #1188. It's not available on the next
branch yet, we need to cut a release for it to be officially fixed, but if any of you are using the dev
branch you should see it fixed.
Thanks for the fix @martskins !