microsoft / microsoft/language-server-protocol
Add "type" to textDocument/references results
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 13k
- Forks
- 1k
- Avg merge
- 6d 1h
- Merged PRs (30d)
- 10
Description
VS Code issue (UI) is at https://github.com/microsoft/vscode/issues/74237
The C/C++ extension wants to be able to send back references of different types that users can determine what "type" of reference it is and filter out unwanted types -- in order to provide functionality equivalent to Visual Studio 2019. The types we want are below. Feel free to change the naming of the example types.
- Confirmed reference (i.e. passes semantic checking): e.g. Type.ConfirmedReference
- Not a reference (i.e. has the same name, but fails semantic checking -- these non-references might be desired in some cases), e.g. e.g. Type.NotAReference
- Reference in a comment, e.g. e.g. Type.CommentReference
- Reference in a string, e.g. Type.StringReference
- Reference in an inactive (preprocessor) region, e.g. Type.InactiveReference (Note: Comment/String references take precedence, so this only applies to identifiers).
- Confirmation in progress, e.g. Type.PendingReference
- Cannot confirm reference (due to some bug or "by design" limitation), e.g. Type.UnknownReference
It's possible other reference types might be desirable as well for other languages or scenarios.
This is the screenshot from VS:

Our current "workaround" is to either send back multiple "types" merged together (ambiguously) or allow users to filter out types via a setting or a progress UI button, e.g. "show confirmed references", "show unconfirmed references" (i.e. 6 and 7).
The relevant LSP that would need to be changed is at
https://microsoft.github.io/language-server-protocol/specification#textDocument_references
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
Start by reading the textDocument/references section of the Language Server Protocol specification linked in the issue and compare the current result shape with the requested reference categories. Done means agreeing on an extensible type representation and documenting the updated protocol behavior, including how clients can distinguish the proposed reference kinds.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100