More Javascript Intellisense with Visual Studio 2008 Beta 2

Previous release of Visual Studio "Orcas" debuted the much awaited feature of Javascript intellisense.  If you have not, you can read about it here, here and here.  Visual Studio 2008 Beta 2 further takes Javascript Intellisense to a whole new level.  Here, I want to briefly give an overview of the enhancements in Javascript Intellisense.

(1) Implicit declarations of variables

Now, variables declared implicitly without the use of the "var" keyword would be shown in the intellisense drop down as follows:

Implicit Declarations of Variables

 

(2) Support for member variables

Member variables would be added into the intellisense dropdown as and when they are declared:

Member variables

 

(3) Support for closures

Member variables defined in the constructor of an object using the "this" keyword will show up as members of the object.  This is illustrated in the example below:

 

 

(4) Support for prototype members

Member variables defined via the prototype object will be shown in the dropdown.

 

(5) Support for Object literals

Members variables defined through an object literal will now be shown in the intellisense dropdown.

 

(6) Intellisense on "this" keyword

When a user types "this." inside a function, intellisense is now triggered listing the members defined earlier in the function.

In addition to this, a heuristic approach is adopted to associate the the "this" object where the function is assigned to a member variable of an object.  For instance, in the following example, when intellisense is triggered, the engine will try to associate the "this" object to the String.prototype object.

 

With these enhancements to intellisense, the user experience of writing Javascript in Visual Stusio 2008 Beta 2 is certainly bound to be much better compared to previous release.  These enhancements came as a result of numerous feedbacks and comments we received from the users of early releases.  So, we would love to hear your feedback and comments on this, do let us know.

 

Sameer Chabungbam
Program Manager
Jscript.DevTools