Skip to content

Go To Definition(F12) option need to be enhanced (Even the Definition one is in another page with in the project))like sublime text?i'm facing this issue from long since i install VS code ?Any help on this? #8547

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

Closed
jrieken opened this issue May 10, 2016 · 21 comments
Labels
Out of Scope This idea sits outside of the TypeScript language design constraints Suggestion An idea for TypeScript Too Complex An issue which adding support for may be too complex for the value it adds

Comments

@jrieken
Copy link
Member

jrieken commented May 10, 2016

From @vinod-a-ext on May 10, 2016 10:49

  • VSCode Version:Latest 1.1.0
  • OS Version:windows

Steps to Reproduce:

  1. In your controller inject a service/factory for a http call
  2. press F12 (go to definition ) to visit the factory which results negative?

Copied from original issue: microsoft/vscode#6238

@jrieken
Copy link
Member Author

jrieken commented May 10, 2016

From @isidorn on May 10, 2016 12:38

Please provide a short code snippet for which this behavior can be reproduced. Or even better create a repository on gitHub which we can clone and see this behavior

@jrieken
Copy link
Member Author

jrieken commented May 10, 2016

From @vinod-a-ext on May 10, 2016 14:50

1.factory.js file

(function() {
'use strict';

    app.factory('Service', function() {
        return{
            Callmefromcontroller : function() {
           return '1';
                }
        }  
});
});

2.controller.js

 // Controller of the App

app.controller('Aboutus2Ctrl', function ($scope,Service) {
Service.Callmefromcontroller();

  });

@jrieken
Copy link
Member Author

jrieken commented May 10, 2016

From @vinod-a-ext on May 10, 2016 14:52

when i press F12 on Callmefromcontroller in controller.js I need to go to Callmefromcontroller defintion method which is in factory.js file?Any help on this

@jrieken
Copy link
Member Author

jrieken commented May 10, 2016

@vinod-a-ext I formatted the snippet to your previous comment, hope it's still correct.

@jrieken
Copy link
Member Author

jrieken commented May 10, 2016

and to clarify, you want go to definition understand the service injection tricks such that the editor knows that the Service argument has been injected and find where it was defined?

@jrieken
Copy link
Member Author

jrieken commented May 10, 2016

From @vinod-a-ext on May 10, 2016 15:16

Spot on @jrieken i need same thing which done perfectly in sublime text editor

@jrieken
Copy link
Member Author

jrieken commented May 10, 2016

ok. moving to the TypeScript team which provides the brain the behind JavaScript and TypeScript smartness in VS Code. I know they have been starting some work on support for angular et al

@mhegazy
Copy link
Contributor

mhegazy commented May 11, 2016

There are no plans on supporting this understanding of angular code. such deep understanding of the run-time behavior of a framework is out of scope at the current time.

@mhegazy mhegazy closed this as completed May 11, 2016
@mhegazy mhegazy added Out of Scope This idea sits outside of the TypeScript language design constraints Too Complex An issue which adding support for may be too complex for the value it adds Suggestion An idea for TypeScript labels May 11, 2016
@jrieken
Copy link
Member Author

jrieken commented May 12, 2016

@mhegazy out of curiosity and cos I met angular folks yesterday: I remember talk about compiler plugins etc. What happened to that?

@vinod-a-ext
Copy link

So I think we have to compile the Runtime complier of sublime text editor 3 which is the best one to do this so far.Moving to sublime Text 3 editor from VS Code.Hoping to come back to Vs code onces i got this feature.

@jrieken
Copy link
Member Author

jrieken commented May 12, 2016

@vinod-a-ext what package are you using with ST?

@vinod-a-ext
Copy link

when I press F12 on the 44 line (refer below image) it (sublime text editor) comes with a pop up listing l files ( by comparing all files in the project with the same name--- on the word I pressed F12) ,so that gives me a quick access to jump to my wanted file.Hope I clarified my question with this?

image

@vinod-a-ext
Copy link

@jrieken No need to add any packages.it's a inbuilt thing!

@kitsonk
Copy link
Contributor

kitsonk commented May 12, 2016

@jrieke, Compiler Extensibility is tracked by #6508 and has references to related tickets (including #6477 which was essentially a duplicate of this already raised by the vscode team 😄 )

@jrieken
Copy link
Member Author

jrieken commented May 12, 2016

@vinod-a-ext Thanks, I learnt something. Let me see what our extension API allows you to do...

@jrieken
Copy link
Member Author

jrieken commented May 12, 2016

@vinod-a-ext I gave it a try: https://marketplace.visualstudio.com/items?itemName=jrieken.fuzzy-definitions.

It's an extension that hooks into go to definition and it uses a combination of symbol search and full text search tricks to find potential definitions.

readme

@AllaKishore
Copy link

@jrieken ,
i installed ext install fuzzy-definitions but it's not working as you explained in the above screen shot.
Any OS limitation?

@jrieken
Copy link
Member Author

jrieken commented May 13, 2016

shouldn't be the case. it's a bit quite and dirty and uses some full test searching tricks. it will surely have issue with large workspaces (hello node_modules folder). can you check the dev tools from within vscode and check if it contains useful info?

@vinod-a-ext
Copy link

Installed-->Tryed-->Resulted as Below But you are on right path Buddy
image

@jrieken
Copy link
Member Author

jrieken commented May 13, 2016

Thanks for checking, I pushed an update which hopefully fixes that... Let's continue to track more issues here: https://github.com/jrieken/fuzzy-definitions/issues. I want to make this a thing 💪

@vinod-a-ext
Copy link

@jrieken --->Refer this jrieken/fuzzy-definitions#1

@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Out of Scope This idea sits outside of the TypeScript language design constraints Suggestion An idea for TypeScript Too Complex An issue which adding support for may be too complex for the value it adds
Projects
None yet
Development

No branches or pull requests

5 participants