redhat-developer / redhat-developer/yaml-language-server
Don't send workspace/configuration to clients that don't support it
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1.5k
- Forks
- 352
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 11
Description
This function call (AFAICT) sends workspace/configuration, but it is called in response to workspace/didChangeConfiguration: https://github.com/redhat-developer/yaml-language-server/blob/3a74bdc22a1ae8a752e89cbf32616eacae163cea/src/languageserver/handlers/settingsHandlers.ts#L34. But that event should already give you the whole configuration!
Worse, the workspace/configuration request is sent to clients that don't support it. For example, I know that ALE (a Vim LSP client) prefers to use the workspace/didChangeConfiguration notification and does not support workspace/configuration, which it indicates by initializing with workspace.configuration capability false.
Essentially, this breaks using yaml-language-server with (for example) custom schema configuration because that configuration is never seen by the server.
I don't know if this could be a bug in the vscode-languageserver Node library, but it seems that sending workspace/configuration in response to the workspace/didChangeConfiguration notification is an anti-pattern.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/languageserver/handlers/settingsHandlers.ts around lines 34 and 41, then inspect how the server handles workspace/didChangeConfiguration and the client's workspace.configuration capability. Reproduce the custom schema configuration case with a client such as ALE; done means unsupported clients are not sent workspace/configuration and their configuration is still seen by the server.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100