Skip to content

Feature Suggestion: Go to implementation #10806

Closed

Description

@RoarkeRandall
  • VSCode Version: 1.4.0
  • OS Version: OS X 10.11.6

Steps to Reproduce:

  1. Press f12 on a function that is an interface type.
  2. Editor will go to declaration of the function on the interface, rather than the implementation (as expected).

In Visual Studio (with resharper) this is a nice feature.

Activity

  1. added
    feature-request
    on Aug 23, 2016
  2. dvlsg commented on Aug 24, 2016

    @dvlsg

    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.

  3. Tyriar commented on Oct 17, 2016

    @Tyriar
    Contributor

    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.

  4. kkovalevskiy commented on Dec 15, 2016

    @kkovalevskiy

    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?

  5. added
    typescript
    and removed on Dec 15, 2016
  6. Tyriar commented on Dec 15, 2016

    @Tyriar
    Contributor

    Thanks for pointing this out Kirill Kovalevskiy (@kkovalevskiy)! I've reassigned this and am very excited about the possibility of being able to use it soon 😉

  7. 5 remaining items

  8. Tyriar commented on Jan 12, 2017

    @Tyriar
    Contributor

    🎆

  9. jrieken commented on Jan 13, 2017

    @jrieken
    Contributor

    screen shot 2017-01-13 at 10 35 41

    Matt Bierner (@mjbvz) I have reopened this because it takes aways the Find References keyboard shortcut

  10. jrieken commented on Jan 13, 2017

    @jrieken
    Contributor

    Sorry, actually none-sense. I was confused with another extension I have

  11. unional commented on Mar 24, 2017

    @unional

    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.

  12. FredrikFolkesson commented on Apr 12, 2017

    @FredrikFolkesson

    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"

  13. mjbvz commented on Apr 12, 2017

    @mjbvz
    Contributor

    Fredrik Folkesson (@FredrikFolkesson) Please open new issues for any problems related to go to implementation. Include a small project and a list of repo steps so that we can investigate

    Thanks

  14. Wenzil commented on May 9, 2017

    @Wenzil

    Has a new issue been opened yet? The issue is still occurring.

    Edit: I opened #26325

  15. 3x1010 commented on Aug 25, 2017

    @3x1010

    Sorry if I post here but I'm getting mad about this topic.
    I can't stand the fact that visual studio code is not able to jump to the definition in a case like this:

    foo = funtion(){
    this.init();
    }

    foo.prototype.init = function(){
    // code
    }

    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.
    Thanks in advance

  16. Tyriar commented on Aug 30, 2017

    @Tyriar
    Contributor

    Matt Bierner (@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() {
    	}
    }
  17. mjbvz commented on Aug 30, 2017

    @mjbvz
    Contributor

    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 s.r.l. (@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 a.init but not on this.init. I've opened microsoft/TypeScript#18171 to track this

  18. locked and limited conversation to collaborators on Nov 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

apifeature-request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions