Skip to content

Add sourceRange to TS Server definition response #19518

Description

@mjbvz

From microsoft/vscode#10037

Problem
For code such as:

import './a/b/c';

VS Code allows you to hover over the path and hold cmd to look up it's definition without pressing f12. This currently is shown as:

screen shot 2017-10-26 at 6 47 36 pm

Note that only the b part of the path is being underlined as expected here. We would expect the entire path to be underlined since this is the symbol we are looking up

Feature Request
In order to highlight the entire path ('./a/b/c) we need additional information on the TS Server definition response that tells us the source range of the symbol. On possible way this could be implemented:

     interface Definition extends FileSpan {
       source?: FileSpan;
    }

    interface DefinitionResponse extends Response {
        body?: Definition[];
    }

This will repeat the same source across all returned definitions. Not sure if there is a better way to add the source information to the API in a backwards compatible way

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    VS Code TrackedThere is a VS Code equivalent to this issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions