Closed
Description
- VSCode Version: 1.8.1
- OS Version: Windows 10
Steps to Reproduce:
- In
a.ts
, export a function type:
export interface MyFunctionType {
(): string;
}
- In
b.ts
, import the type and export a variable which implements it
import {MyFunctionType} from "./a";
export function MyFunction: MyFunctionType = () => {
return "test";
}
- In
c.ts
, import the function variable, and invoke it
import {MyFunction} from "./b";
MyFunction();
- 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.