Skip to content

Holding Cmd while hovering a symbol shows LocationLink's "targetSelectionRange" instead of "selectionRange" as preview #104369

@DanTup

Description

@DanTup

When returning Location classes from a DefinitionProvider, VS code shows a preview of the code if you hold Cmd while hovering over a symbol:

Screenshot 2020-08-10 at 14 33 29

Multiple lines are shown, leading me to believe this is intended to show a snippet of the code that defines this symbol.

However, if I switch to using LocationLink where targetRange points at the full code snippet and targetSelectionRange includes only the name of the function (the LSP docs say "e.g the name of a function" for targetSelectionRange) then the preview only shows the targetSelectionRange code, which means the preview shows only the function name (which seems a bit pointless):

Screenshot 2020-08-10 at 14 36 17

It seems like maybe this should be using the targetRange so there is some preview of the code, as it did for Location?

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable bugeditor-symbolsdefinitions, declarations, referencesverifiedVerification succeeded

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions