Skip to content

Go to Definition does not work as expected #65

Open
@ator-dev

Description

Go to Definition (usually invoked with F12), by convention, works as follows:

  • If caret is on a symbol instance such as a function call or variable use, the caret is taken to the first character of the symbol at the place it is declared.
  • If caret is on a symbol instance such as a function or variable declaration:
    • If there is one use of the symbol across files in the current workspace, the caret is taken to the first character of the symbol at the place it is used.
    • If there is more than one use of the symbol across the current file, a list UI opens showing the lines of code where it is either declared or used, with the selection on the place it is declared. The user can select one of these items for their caret to be taken to the first character of the symbol at the place it appears.
    • If there is more than one use of the symbol across multiple files in the current workspace, the same list UI opens, but with folding sections containing the lines of code, one section per file (in the file's name).

Current behaviour:

  • If caret is on a symbol instance such as a function call or variable use, the caret is taken to the start of the line at the place it is declared.
  • If caret is on a symbol instance such as a function or variable declaration, the action is blocked with "No definition found".

I believe the list UI is provided by VSCode, as it seems to be constant between extensions.

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions