You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Go to definition does not find a definition in typescript #22385
interface ITest {
test(): void;
}
class Test implements ITest {
test() {
return null;
}
}
Right click on the test() implementation and click 'go to definition'. It will say there is "no definition found for 'test'". I expected it to go to the definition.
Go to implementation from the interface does work.
Yes, because test() in Test is the implementation, isn't it, and test() in ITest is the definition? I would say it's a good thing to let the user be able to go to the Interface from the implementation. From what I see, there is no way now to go directly to the Interface declaration from the class implementation, is there?
I'm still not sure that go to definition should go to the interface declaration in this case, but perhaps go to type definition should do what you describe?
I've opened microsoft/TypeScript#14588 against TypeScript to track this and discuss the design of this feature
Activity
mjbvz commentedon Mar 10, 2017
The current behavior seems correct to me. If you right click on
testinTest, you are already at the definition of the method.Are you expecting it to go to
ITesttestinstead?pkeuter commentedon Mar 10, 2017
Yes, because test() in Test is the implementation, isn't it, and test() in ITest is the definition? I would say it's a good thing to let the user be able to go to the Interface from the implementation. From what I see, there is no way now to go directly to the Interface declaration from the class implementation, is there?
mjbvz commentedon Mar 10, 2017
No not currently.
I'm still not sure that
go to definitionshould go to the interface declaration in this case, but perhapsgo to type definitionshould do what you describe?I've opened microsoft/TypeScript#14588 against TypeScript to track this and discuss the design of this feature
Thanks.