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

Check if dynamic registration is enabled before executing onDidChangeWorkspaceFolders #378

Merged
merged 2 commits into from
Dec 16, 2020

Conversation

JPinkney
Copy link
Contributor

Signed-off-by: Josh Pinkney [email protected]

What does this PR do?

It seems that vscode-languageserver automatically sends a client/registerCapability to the client if you use onDidChangeWorkspaceFolders on the server side. This means that currently the server will then send client/registerCapability even if the client doesn't support it. Since workspaceFolders don't have dynamicRegistration in the initialization according to the LSP spec, there's no way to tell if we should be using onDidChangeWorkspaceFolders and thus sending the client/registerCapability on the server side. This PR makes it so that onDidChangeWorkspaceFolders is only registered when the formatter dynamic registration is available

What issues does this PR fix or reference?

#370
#377

Is it tested? How?

@coveralls
Copy link

coveralls commented Dec 15, 2020

Coverage Status

Coverage remained the same at 80.506% when pulling b3b7ae9 on workspace-folders-temp-fix into b9b5225 on master.

@joshuawilson
Copy link
Member

@JPinkney I can't think of how to test this but I'm going to ask anyway, is there a way to write a test that covers this?

@JPinkney
Copy link
Contributor Author

is there a way to write a test that covers this?

Not currently, I have some code that completely refactors the language server so that you can test almost everything but I won't have it fully ready until friday-ish

@joshuawilson
Copy link
Member

I figured as much, that is why I approved without requiring the test.

@JPinkney JPinkney merged commit 385f773 into master Dec 16, 2020
@JPinkney JPinkney deleted the workspace-folders-temp-fix branch December 16, 2020 11:41
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

Successfully merging this pull request may close these issues.

4 participants