This article will be useful to developers who use Visual Studio to work with JavaScript. For review, we offer a plugin for Visual Studio - Javascript Parser Extension. Versions of VS2008, 2010, 2011 are supported. The open source project, hosted by
Google Code , is also published in the
Visual Studio Gallery .
This plugin is designed to help in working with large, intricate sections of JavaScript code, which are often “inherited” and navigation through which is quite tedious. Also, the plugin is convenient for use with the new code, in the development process, if the file size is significant.
The main functionality is to build a tree of functions and display it in a convenient form in the form of a Visual Studio panel. When clicking on the name of the function, navigation to the beginning of the declaration is performed. Also, comments to the function are displayed as a tooltip. It is possible to add "tags" to the functions in the form of 6 different flags. The font and color of the marked functions can be adjusted additionally. It is very convenient - the functions demanding attention will be evident at once.
Automatic syntax checking is also very useful, errors found by the analyzer are shown in a convenient and quite visible form. It is possible to quickly move to the place of error. This allows you to quickly identify problem areas where, for example, an extra comma or bracket is located.
Screenshot:
')
Detailed list of functionality:
- Function tree for quick navigation.
- Inline script support in script tags.
- Labels are available in the context menu of the tree. Saved when you restart the studio.
- The selection of the active function in the tree is where the cursor is.
- Task List - shows a list of TODO comments, with the ability to quickly navigate.
- Search by the name of the desired function in the file. The main feature - support for the style of Pascal and Camel, allows you to search by the first letters of the composite name, for example, the search for “SP” will give out setPage, SetPosition. It is possible to customize the hotkey to trigger a search, “Tools> Options> Environment> Keyboard” command “View.JavascriptParserFind”.
- Sort the tree alphabetically.
- Enable / Disable hierarchy in the tree.
- Turn on / off line numbers in the tree.
- Filtering a tree by tags - shows only marked nodes.
- Filtering of anonymous functions - you can turn them off if your eyes are corporeal.
- Configuring analyzed file extensions - you can enable it for everyone, or you can add your exotic php type extension to the list.
- The analyzer quite successfully handles almost any script, it shows both anonymous and self-invoking functions.
Installing the plugin in VS2010 / 2011 is available through the Extension Manager in the Tools menu. Also on the project site you can find all versions, including VS2008.
In order to open the plug-in panel you need to find it in the studio menu: “View> Other Windows> Javascript Parser”. All the functionality is quite easily detectable when exploring the top menu of the panel. In the same place, in the top menu there is a link to the settings window.
In VS2010 / 2011, a window with plugin settings is also integrated into general studio settings.
The plugin has been published for a long time in Visual Studio Gallery, has collected quite good ratings and reviews. The publication on Habré aims to draw attention to the new version 3.4, expand the audience and get more reviews. Constructive criticism and suggestions are welcome.