-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
Feature Suggestion: Go to implementation #10806
Comments
This is actually available in Visual Studio 2015 Update 1 without resharper. I believe a default shortcut of Ctrl+F12 was added in Update 2. |
This would be really handy to navigate vscode's source faster, currently I have to use view references and navigate to the implementation in the peek view. |
As I can see, tsserver has added support of this feature on their side (microsoft/TypeScript#10482), so why we still don't have it in vs code? |
Thanks for pointing this out @kkovalevskiy! I've reassigned this and am very excited about the possibility of being able to use it soon 😉 |
For microsoft#10806 Initial prototype of using the TypeScript Go To Implementation Feature. Adds a go to implementation command for js and ts documents. This has a few issues at the moment: * We likely would want to expose `go to implementation` functionality for other languages. Therefore, it would make sense to standardize an api for this base on the existing DefinitionProvider api. * The location values that typescript returns are not correct some of the time. I'll double check that this is not a bug on our side, but the feature may need some more polish before we can ship it.
@Tyriar Taking this back because it shouldn't be a TypeScript only solution but implemented in the spirit of other language features, like go to definition, find referenced etc |
For microsoft#10806 Adds a new API for supporting `go to implementation` command for languages. Implements an example for TS
* Add Go To Implementation Api For #10806 Adds a new API for supporting `go to implementation` command for languages. Implements an example for TS * Rename * Cleanup
🎆 |
@mjbvz I have reopened this because it takes aways the Find References keyboard shortcut |
Sorry, actually none-sense. I was confused with another extension I have |
Just tested and it is not working. It still routed to the declaration file. UPDATE: didn't have time to create a repro yet. I'm trying to [Ctrl+F12] from an import statement of another package and landed on the declaration file. |
I also have problems here, going to declaration on another package works and I get to the d.ts file, but going to implementation I only get "No implementation found" |
@FredrikFolkesson Please open new issues for any problems related to Thanks |
Has a new issue been opened yet? The issue is still occurring. Edit: I opened #26325 |
Sorry if I post here but I'm getting mad about this topic. foo = funtion(){ foo.prototype.init = function(){ if I press F12, Alt F12, Ctrl F12, Shift F12, Ctrl F12 or whatever on "this.init()" Visual Studio Code is not able to jump to the foo.prototype.init method. Where am I wrong? In Visual Studio 2015 this works, also it works on sublime. |
@mjbvz is this just a limitation of tsserver that it doesn't check the prototype? Does VS2015 use some other system? // this.init() go to def doesn't works
var foo = function() {
this.init();
};
foo.prototype.init = function() {
// code
};
// this.init() go to def works
class Foo {
constructor() {
this.init();
}
init() {
}
} |
VS2015 used a different JavaScript analysis engine, not one the from typescript that we use and that VS2017 uses. That engine could handle some cases better than we can, but also had some performance issue and to my knowledge was not being actively maintained. However the case that @3x1010 provided looks like bug in TS. For the code: function foo() {
this.init();
}
foo.prototype.init = function () { /*...*/}
const a = new foo();
a.init() Go to definition does work on |
Steps to Reproduce:
In Visual Studio (with resharper) this is a nice feature.
The text was updated successfully, but these errors were encountered: