-
Notifications
You must be signed in to change notification settings - Fork 92
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
Support workspace/configuration
request for every server initilize
#510
Comments
This is actually pretty bad. We can't send Possibly we can get away with doing this work when we receive the I have read several of the issues about this and honestly I'm very confused about how this is supposed to work :( |
Okay, so I think we could try and do something like what is described here as what rust-analyzer does: microsoft/language-server-protocol#972 (comment) Namely:
|
That is what I want. I think the only problem is I'm not sure if we can send Night is long, let me try it now:) |
You're explicitly allowed to send The only thing is that I guess the client might start sending you requests during that time, so you probably have to be responsive. But we do already have the facility to change the config dynamically, so it shouldn't be too bad. |
It just means that e.g. if you somehow hit a formatting request immediately after initialization you might get the default behaviour. But that probably just means that the default behaviour should be "no formatting", I guess. |
Sounds like indeed the answer is "tough, accept it": microsoft/language-server-protocol#1006 (comment) |
BTW, I'm trying to find a way to ensure the client will send |
I think we can't count on that, though, so we probably need to handle the other case anyway. |
After reading some lsp code I found that patching handlers for Is it possible to add a field about |
So, we already have this callback that should give us all the information we need to process config: lsp/lsp/src/Language/LSP/Server/Core.hs Line 284 in 97c7660
I think the only thing we need to be told additionally is the "section". I agree it's a little tricky in |
Seems not this, Left this up and see if haskell/haskell-language-server#3745 works firstly... |
I mean, that tells us what to do when we get a new config. Actually implementing it we can probably pull out a part of |
It causes troubles due to following the newer LSP spec which HLS is not ready for. For details, see haskell#920 and haskell/lsp#510, etc...
Hello, I have also struggled with this issue on my LSP implementation. My workaround was to:
This is hacky, but it seems better than updating the config after we received some requests. I see that this is closed, but maybe this can help someone with the same issue. |
I think we now handle this pretty well, we send |
In the latest release of
vscode-language-server-node
, they don't sendworkspace/didChangeConfiguration
more when the server is initialized, which causes haskell/vscode-haskell#920.Following the comment of the
SynchronizeOptions
below, they suggest usingworkspace/configuration
, so I'm thinking to extendServerDefinition
with a new field to sendworkspace/configuration
while the server is initiated.lsp/lsp/src/Language/LSP/Server/Core.hs
Line 280 in 97c7660
https://github.com/microsoft/vscode-languageserver-node/blob/f2ff7d55464a1f58f978cb6635bd8865f050553c/client/src/common/configuration.ts#L132
The text was updated successfully, but these errors were encountered: