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

Typescript "Go to Definition" goes to function type, not its implementation #18321

Closed
ta-stott-oe opened this issue Jan 9, 2017 · 1 comment
Assignees
Labels
*duplicate Issue identified as a duplicate of another issue(s) feature-request Request for new features or functionality javascript JavaScript support issues typescript Typescript support issues

Comments

@ta-stott-oe
Copy link

ta-stott-oe commented Jan 9, 2017

  • VSCode Version: 1.8.1
  • OS Version: Windows 10

Steps to Reproduce:

  1. In a.ts, export a function type:
export interface MyFunctionType {
    (): string;
}
  1. In b.ts, import the type and export a variable which implements it
import {MyFunctionType} from "./a";
export function MyFunction: MyFunctionType = () => {
    return "test";
}
  1. In c.ts, import the function variable, and invoke it
import {MyFunction} from "./b";
MyFunction();
  1. Place the caret somewhere inside the function call and Go to Definition.

Outcome
VSC takes you to a.ts (where the type of the variable is defined), not b.ts (where the variable is defined).

Real life example
You have a Knockout view model class with properties of type KnockoutObservable<T> (which may be invoked as a function). When you try to navigate to the definition of such a property, VSC takes you to the definition of KnockoutObservable in knockout.d.ts, not to the view model class.

@mjbvz mjbvz added feature-request Request for new features or functionality javascript JavaScript support issues typescript Typescript support issues *duplicate Issue identified as a duplicate of another issue(s) labels Jan 9, 2017
@mjbvz
Copy link
Collaborator

mjbvz commented Jan 9, 2017

Closing as duplicate of #10806

@mjbvz mjbvz closed this as completed Jan 9, 2017
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*duplicate Issue identified as a duplicate of another issue(s) feature-request Request for new features or functionality javascript JavaScript support issues typescript Typescript support issues
Projects
None yet
Development

No branches or pull requests

3 participants