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

Can I rely on didChangeConfiguration to be always called after server initialization? #524

Closed
henryju opened this issue Sep 23, 2019 · 1 comment
Labels
*question Issue represents a question, should be posted to StackOverflow (VS Code)

Comments

@henryju
Copy link
Contributor

henryju commented Sep 23, 2019

Hi,

Looking at the startup sequence of my LS under VSCode, I noticed that the didChangeConfiguration notification seems to be always sent before the first didOpen. I had the idea to rely on that to get the initial values of my extension settings (to avoid passing them as initialize params, or doing an extra configuration request). But then I realized this behavior doesn't seem to be specified in the LSP. Is it intentional? Can I rely on it? Will it be future proof?

[Trace - 15:17:14] Sending request 'initialize - (0)'.
[Trace - 15:17:23] Sending notification 'initialized'.
[Trace - 15:17:23] Sending notification 'workspace/didChangeConfiguration'.
[Trace - 15:17:23] Sending notification 'textDocument/didOpen'.
@dbaeumer
Copy link
Member

No, you can not rely on this since it is not speced that way. In general you should rely on the new way to getting configuration by using the workspace/configuration request that is sent from the server to the client. See https://microsoft.github.io/language-server-protocol/specification#workspace_configuration.

@dbaeumer dbaeumer added the *question Issue represents a question, should be posted to StackOverflow (VS Code) label Sep 24, 2019
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*question Issue represents a question, should be posted to StackOverflow (VS Code)
Projects
None yet
Development

No branches or pull requests

2 participants