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

No LSP workspace/didChangeConfiguration notifications after language server restart #1295

Closed
lukaszsamson opened this issue Aug 13, 2023 · 8 comments · Fixed by #1298
Closed
Assignees

Comments

@lukaszsamson
Copy link

lukaszsamson commented Aug 13, 2023

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.81.1
  • OS Version: macOS

I'm the autor of https://github.com/elixir-lsp/vscode-elixir-ls. Recently VSCode stopped sending workspace/didChangeConfiguration after server restart, which resulted in open tickets (elixir-lsp/vscode-elixir-ls#366, elixir-lsp/vscode-elixir-ls#345). Up until now the extension relied on LanguageClientOptions.synchronize.configurationSection which turned out to be deprecated (#620). It seems the recent change is affecting other language servers (e.g. haskell/vscode-haskell#920) and some are downgrading the language server client package (haskell/vscode-haskell#934).
I started migrating to workspace/configuration request and dynamic registration of workspace/didChangeConfiguration as advised in microsoft/language-server-protocol#676 and while I'm able to get configuration that way there is a problem with notifications. Even if I explicitly register for workspace/didChangeConfiguration via client/registerCapability, VSCode does not send LSP workspace/didChangeConfiguration notifications after language server restart.

Steps to Reproduce:

  1. Create an extension with language server that subscribes to workspace/didChangeConfiguration via dynamic capability registration
  2. Verify that notification reach the server
[Trace - 14:06:50] Sending notification '$/setTrace'.
Params: {
    "value": "verbose"
}
[Trace - 14:06:50] Sending notification 'workspace/didChangeConfiguration'.
Params: {
    "settings": {redacted}
}
  1. Crash the server and wait for it's restart
  2. Verify that after restart notifications no longer reach the server
[Trace - 14:11:50] Sending notification '$/setTrace'.
Params: {
    "value": "verbose"
}
@VSCodeTriageBot
Copy link
Collaborator

Thanks for creating this issue! It looks like you may be using an old version of VS Code, the latest stable release is 1.81.1. Please try upgrading to the latest version and checking whether this issue remains.

Happy Coding!

@lukaszsamson
Copy link
Author

I checked and the problem still exists on 1.81.1

@lukaszsamson
Copy link
Author

More info: the extension is currently build with vscode-languageclient 8.1.0 and targets vscode engine ^1.75.0

@dbaeumer dbaeumer transferred this issue from microsoft/vscode Aug 16, 2023
@dbaeumer
Copy link
Member

I was able to reproduce this however the fix might cause some other problems so I need to think if the taken approach is a proper solution. If I produce a next release would you be willing to use it?

dbaeumer added a commit that referenced this issue Aug 16, 2023
@lukaszsamson
Copy link
Author

If I produce a next release would you be willing to use it?

Sure

@lukaszsamson
Copy link
Author

@dbaeumer when can I expect a new release?

@dbaeumer
Copy link
Member

I am in the process of creating one. Might still take a little

@dbaeumer
Copy link
Member

Release 8.2.0-next.2 for client and server.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants
@lukaszsamson @dbaeumer @TylerLeonhardt @VSCodeTriageBot and others