microsoft / microsoft/language-server-protocol
Support ServerCancelled on more request.
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 13k
- Forks
- 1k
- Avg merge
- 6d 1h
- Merged PRs (30d)
- 10
Description
How can a language server decline to answer a request for the time being (e.g. because it's not ready), but without popping up a message-box?
Currently we are responding with RequestCancelled because this is the only error-code that VSCode won't pop up a message-box for. But it's an abuse: this is not what the spec says this error-code is for.
For instance, autocomplete. If the user wants member-autocomplete x.|, showing all the members available on x, then a language server can answer this pretty soon after initialization. But if the user wants global-autocomplete const x = new | then the language server needs to index every top-level symbol that appears in the entire project before it can give a definitive answer. In a project of 500k files, this indexing can easily take 1min+. It would be wrong to deny member-autocomplete for that full 1min.
Therefore: the language server wants to receive all autocomplete requests from fairly soon on, but for some of them (based on its own internal processing) it wants to decline to answer. Moreover that "decline-to-answer" shouldn't pop up a message-box. It would be intolerable to have a message-box appear for every keystroke after const x = new |.
The language server could respond with an empty autocomplete answer for when it's not ready. Or, in the case of global-autocomplete, it could respond with a partial answer that includes all the top-level symbols that it has found so far. But this is scary -- we have no idea whether VSCode will cache the empty answer, and we need a guarantee that it won't.
Contributor guide
No contributing guide indexed for this repository
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
No files or tests are named in the issue. Start by tracing how the protocol and VS Code handle ServerCancelled and RequestCancelled for autocomplete requests; done requires a defined non-popup response, user-visible behavior, and caching guarantee.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript, vscode
- Domain
- api, developer-experience
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100