microsoft / microsoft/language-server-protocol

Clarify what supportsCustomValues in the meta model really means

Open
#2,035 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

clarification
Dominant language
TypeScript
Stars
13k
Forks
1k
Avg merge
6d 1h
Merged PRs (30d)
10

Description

I currently have some custom code that determines whether to accept any value for enums, but since the meta model now has supportsCustomValues I planned to migrate to it.

However, it's not clear to me if this value really means what I thought it meant. I thought it meant that if supportsCustomValues != true then the values passed for this enum can be validated (and we can reject a request as having invalid parameters if it passes values that weren't in the spec we used).

However, the SymbolKind enum does not have "supportsCustomValues": true, yet the client can send a DocumentSymbolClientCapabilities that contains a valueSet saying which symbols the client supports, which presumably in the future could be values that my server did not know about when the validation code was written.

So I don't think I can use this field in the way that I hoped, and that makes me wonder what it really means. If we can't assume that !supportsCustomValues means we can validate those values, what can we actually use this flag for?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the meta model's supportsCustomValues definition alongside the SymbolKind enum and DocumentSymbolClientCapabilities valueSet described in issue #2035. Determine what the flag guarantees for protocol consumers and document its intended use, including whether it can support validation of unknown enum values.

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
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.