microsoft / microsoft/language-server-protocol
When are params and error data optional?
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 13k
- Forks
- 1k
- Avg merge
- 6d 1h
- Merged PRs (30d)
- 10
Description
The JSON-RPC spec says that the params field of a request or notification is optional; and similarly for the data field on a response error.
However, in many cases omitting params is nonsensical: the user can't ask for a hover without telling us where! And conversely, in the few cases where params aren't necessary, they must be omitted (because there isn't even a param type!).
So the approach we have been taking in HLS is:
- If the metamodel specifies a parameter type for a method, then
paramsmust be present - If the metamodel does not specify a parameter type, then
paramsmust be absent
Is this right? If so, could we say as much in the spec?
There is a similar question for error data: when it is specified in the metamodel that a method has an error data type, does that mean that any errors for that method must include error data, or is it still optional?
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 implementation file or test is identified. Start by reviewing the JSON-RPC and LSP specification sections covering request params and error data; done means the specification explicitly resolves when each field is required, optional, or forbidden.
Written by the indexing model from the issue text.
Assessment
- Domain
- api, documentation
- Issue type
- Documentation
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100