Skip to content

Add "type" to textDocument/references results (icon, filtering) #74237

Open
@sean-mcmanus

Description

@sean-mcmanus

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 are

  1. Confirmed reference (i.e. passes semantic checking): reference icon
  2. Not a reference (i.e. has the same name, but fails semantic checking): cancel icon
  3. Reference in a comment: comment icon
  4. Reference in a string: string icon
  5. Reference in an inactive (preprocessor) region: ? icon (or a better one, since it conflicts with 7)
  6. Possible reference (Confirmation in progress): progress icon?
  7. Possible reference (Confirmation canceled): ? icon (or a better one, since it conflicts with 5 and 7) -- this "type" doesn't exist in VS, but it seems like it should (at least for us).
  8. Cannot confirm reference (due to some bug or "by design" limitation): ? icon

This is the screenshot from VS:

image

Our current "workaround" is to only send back Confirmed References (number 1), although we also plan to have some progress UI with a button that allows users to view the Confirmation in progress (number 6 items, merged in with number 1 items). We're currently implementing this for June: microsoft/vscode-cpptools#15 .

The relevant LSP that would need to be changed is at
https://microsoft.github.io/language-server-protocol/specification#textDocument_references

Metadata

Metadata

Labels

apieditor-symbolsdefinitions, declarations, referencesfeature-requestRequest for new features or functionality

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions