Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sourceRange to TS Server definition response #19518

Closed
mjbvz opened this issue Oct 27, 2017 · 2 comments
Closed

Add sourceRange to TS Server definition response #19518

mjbvz opened this issue Oct 27, 2017 · 2 comments
Labels
VS Code Tracked There is a VS Code equivalent to this issue

Comments

@mjbvz
Copy link
Contributor

mjbvz commented Oct 27, 2017

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

@mjbvz mjbvz added the VS Code Tracked There is a VS Code equivalent to this issue label Oct 27, 2017
@mhegazy
Copy link
Contributor

mhegazy commented Oct 27, 2017

is #19175 what u are looking for?

@mjbvz
Copy link
Contributor Author

mjbvz commented Oct 27, 2017

Yes that's it exactly. Glad to see someone is already looking into this

@mjbvz mjbvz closed this as completed Oct 27, 2017
@microsoft microsoft locked and limited conversation to collaborators Jun 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
VS Code Tracked There is a VS Code equivalent to this issue
Projects
None yet
Development

No branches or pull requests

2 participants