Allow extensions to report "additional"/groups of references via ReferenceProvider #144699
Labels
*duplicate
Issue identified as a duplicate of another issue(s)
editor-symbols
definitions, declarations, references
Find References/
ReferenceProvider
can return multiple results, but they all appear in a flat list and are treated equally. In some cases, a language server might want to return some additional references that are of interest, but are not strictly references to what was requested.For example, let's say you have code using a Builder pattern. The Builder may be code-gen'd and in a different file:
Code that defines the
User
class and uses the builder may look like this:If the user does "Find References" on
name
in theUser
interface, it will not include the setting ofbuilder.name
near the end, because it's not a direct reference. However, in this case it's possible the user would be very interested in this reference because if they're doing Find References onname
, they might be looking for all places that set names forUser
s.It would be nice if a language server/extension could provide additional references like this, that are visually separated in the UI, for example:
Note: Although I've used TypeScript as an example here for familiarity, I'm not necessarily asking for TypeScript to support the scenario above, I'm interested in VS Code having the API for other extensions/language servers to be able to use where they might have this sort of data.
The text was updated successfully, but these errors were encountered: