Visual Studio 2008 Intellisense for Ext JS

Published 12 July 09 10:59 AM | jacobl 

Ever thought it would be totally boss to have JavaScript Intellisense for Ext JS in Visual Studio 2005? Too bad. If you were talking about VS 2008, though, I've got your back.

Intelli-Referencing External JavaScript

VizitSP is a fairly large project and much of that heft is on the client side. With that, we have a lot of JavaScript to manage. One of the techniques we use to help ease the burden is to maintain separate files for each JS class and then merge and minify them all together during the build process. Unfortunately, splitting the files up sacrifices all the Intellisense we would get for free if we hadn't. Not exactly.

Scott Guthrie posted this article about JavaScript Intellisense in Visual Studio back in 2007. While going over some of the basics, he also talks about how to reference external JS files using an XML comment at the top of your script.

   1: /// <reference path="path/to/script.js" />

They even load references of references. That means that when I reference the script I have located at "path/to/script.js" that has an XML reference comment pointing at "path/to/otherScript.js", my script gets Intellisense for script.js and otherScript.js! I'm easily amused.

Back in November, Visual Studio Web Tools Program Manager, Jeff King, posted this FAQ on JScript Intellisense in Visual Studio 2008 that you should take a look at as well.

Give me Ext JS

This is all well and good, but what I really want is all of Ext JS at my fingertips. I want to be able to get some Intellisense love for the entire API. My first thought was to just add a reference comment pointing to ext-all-debug.js and maybe ext-base.js.

Long story short, that blew up in my face and was way too big of an undertaking to deal with. I began stripping out any incompatible bits of code and got nowhere fast. A little searching on the net led me to find people out there who clearly have way more time on their hands need for this than I do. While there are a few forum posts on the topic with supposed links to working script, this is the only one that didn't return a 404.

While it's not entirely there, it's pretty close. Some classes exist in multiple places in Ext's namespace as a convenience and while the object itself appears in the Intellisense, a constructed version of it does not have any members or methods. I tend to use Ext.form.BasicForm over Ext.BasicForm... so, I'm out of luck. However, it would not take much to add it.

Comments

No Comments
Anonymous comments are disabled