Go To Definition for JavaScript Functions in Visual Studio 2011
By | December 9, 2011

Visual Studio 2011 has some great changes for CSS, HTML and  JavaScript editor. The changes enables developer to manage and organize code better, do work fast and easily access. In my previous tips I talked about many such new features for Visual Studio 2011. In this post I am going to discuss once nice enhancement of JavaScript Editor in Visual Studio 2011 which is “Go To Definition ( F12) ” for JavaScript functions.

This features is already available from a way long time in C#, VB or other Code editor.  There is nothing to discuss what this options does, yes! it’s just automatically navigate to the method definition. Like other Code Editor, now you can use the same features in Java Script Editor as well.

Now, in new JavaScript editor you will find “Go To Definition” as a context menu option.

image thumb6 Go To Definition for JavaScript Functions in Visual Studio 2011

Select on that menu option or Press “F12” from that calling method,  you will automatically navigate to the method definition.

image thumb7 Go To Definition for JavaScript Functions in Visual Studio 2011

This is really helpful when we are dealing with complex JavaScript Files.

image thumb8 Go To Definition for JavaScript Functions in Visual Studio 2011

JavaScript Go To Definition can navigate to different files as well. If the calling method is defined on some other file “Go To Definition” will automatically navigation to that JS File itself ( Similar to  other code editors)

image thumb9 Go To Definition for JavaScript Functions in Visual Studio 2011

Yes, now navigation with JavaScript files very easy and specially when searching methods with in a complex JQuery files.

image thumb10 Go To Definition for JavaScript Functions in Visual Studio 2011

Hope this helps !

Cheers !

Abhijit