Sunday, August 17, 2008

How To: Setup JavaScript IntelliSense for ExtJS in Visual Studio 2008 (SP1)

One of the much awaited features incorporated in Visual Studio 2008 Service Pack 1 is the JavaScript IntelliSense support for 3rd Party JavaScript Frameworks like ExtJS, jQuery, Prototype etc.

Now you can add references to your 3rd party libraries in you JavaScript files and JavaScript blocks, and Visual Studio 2008 (on installation of Service Pack 1) will start recognizing the classes and functions defined in those libraries.

In order to setup ExtJS JavaScript IntelliSense you just need to add the following lines (/// reference tags) in your JavaScript files or script blocks to make it work. (Adjust the relative paths to the two JavaScript files as per your website hierarchy)

And here is the outcome; ExtJS based classes are now available in IntelliSense

Moreover a variable that’s initialized as with ExtJS based Store is now showing the respective methods of class in IntelliSense

I have updated the ASP.NET AJAX with ExtJS sample to incorporate this JavaScript IntelliSense feature. You can download the updated code sample from here.

What I can say about this feature is; it is simply a superb addition in Visual Studio feature set and will definitely increase the popularity and penetration of JavaScript based frameworks and libraries.