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

How can I make sure my LS gets config change notifications? #620

Closed
davidanthoff opened this issue Apr 29, 2020 · 5 comments
Closed

How can I make sure my LS gets config change notifications? #620

davidanthoff opened this issue Apr 29, 2020 · 5 comments
Labels
info-needed Issue requires more information from poster

Comments

@davidanthoff
Copy link

My understanding is that LanguageClientOptions.synchronize.configurationSection is deprecated, correct? And that instead I'm supposed to pull config values via sending workspace/configuration from the server to the client.

One thing I don't understand in this model is how the client (VS Code/LanguageClient) then knows for which config setting changes it should send workspace/didChangeConfiguration notifications? And in fact, when I remove the LanguageClientOptions.synchronize.configurationSection part, then I don't seem to receive any workspace/didChangeConfiguration notifications on the server, even when I edit some settings from my extension.

@dbaeumer
Copy link
Member

Since the server issues the request the server needs to register for change events as well. In the VS Code LSP implementation this is done using:

connection.client.register(DidChangeConfigurationNotification.type);

Let me know if there is still something that is unclear.

@dbaeumer dbaeumer added the info-needed Issue requires more information from poster label Apr 30, 2020
@davidanthoff
Copy link
Author

Ah, yes, when I register for that client capability, I do get the workspace/didChangeConfiguration notifications now!

But I'm getting them for any settings change now, even if I for example change a setting in the Python extension, I get that notification in my Julia language server. Is there some way to scope this a little bit more?

I think I still don't fully understand the best strategy to implement this here... Would we essentially implement a cache for settings in our LS, and whenever we receive a workspace/didChangeConfiguration message we just wipe the entire cache?

@dbaeumer
Copy link
Member

dbaeumer commented May 4, 2020

@davidanthoff this is exactly what I do. The problem is that most clients don't have a fine grained invalidation event. VS Code has one since a couple of month so we could thing about adopting it.

@vscodebot vscodebot bot closed this as completed May 14, 2020
@vscodebot
Copy link

vscodebot bot commented May 14, 2020

This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.

Happy Coding!

@davidanthoff
Copy link
Author

Great, then we’ll do it that way as well :) Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

2 participants