Reputation: 162
WebStorm has a nice feature for TypeScript: I can right-click on a function reference in a *.html file, either inside a script tag or inside an event handler for a dom element (e.g. 'onclick'), and when I select Go To Declaration, it gives me the option to select the TypeScript definition, so I can jump straight to the TypeScript code.
I'm trying to do something similar in Visual Studio 2013. Since Visual Studio doesn't seem to support this out of the box, I tried a hack that I thought might work. I defined a "link" file, with a "links.ts" file name, which actually contains 100% valid JavaScript, but links to functions defined within other TypeScript files.
I then add a script reference to links.ts in my html page. The problem is, the "Go To Definition" fails if I reference a ts file, even though if I instead reference links.js, which is identical, it works. Of course, if I reference links.js, then it opens the JavaScript editor, and if I then right-click within the file and go to definitions, it takes me to the *.js files, not to the *.ts files, which is what I want.
Any suggestions?
Upvotes: 2
Views: 3268
Reputation: 1147
I'd definitely suggest the ReSharper.
Press Alt + 7 and a get list of useful navigation shortcuts (Navigate to...):
So, the answer: Yes, press F12.
Upvotes: 2