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

Don't send textDocument/didSave unless server advertises support for it #834

Open
chenguanda opened this issue Jun 11, 2019 · 7 comments
Open

Comments

@chenguanda
Copy link

More information: dart-lang/sdk#36464 natebosch/vim-lsc#164 sublimelsp/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%
@Gonzih
Copy link

Gonzih commented Jan 31, 2021

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

@martskins
Copy link
Collaborator

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.

@martskins
Copy link
Collaborator

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.

@Gonzih
Copy link

Gonzih commented Feb 2, 2021

@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'],
\ }

@martskins
Copy link
Collaborator

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.

@martskins
Copy link
Collaborator

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.

@Gonzih
Copy link

Gonzih commented Feb 6, 2021

Thanks for the fix @martskins !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants