We, developers, love nothing in Visual Studio more than its intellisense. Right ?? Yes of course, I guess that’s my reader's answer if they have been using Visual Studio for sometime.
Why not, since it’s getting smarter, no let's say more intelligent with every release of Microsoft Visual Studio.
There is more.
Either you script within your page or in a separate file you will get the intellisense like below:
ShowLove(). You can see in the second screen that I can see it from my aspx page and all I needed is to add a reference to the js file like we all used to:
If you are not installing VS 2008 SP1, the above example won’t work for you until you install this HotFix. I will recommend you to install the SP1 which we will need for the other part of this article Jquery Intellisense.
The fun doesn’t stop here. Actually the fun will just start with the second part of this article “just below”, so let's have fun …
Second: Jquery Intellisense
To use this great addition to Intellisense, you will need the following:
- Download and install VS 2008 SP1
- Download and install this patch to support vsdococ.js files.
- Download Jquery and Jquery-vsdoc.js files
After you finished, add Jquery file along with the vsdoc file in the same directory.
- Make sure that the vsdoc file has exactly the same name as the jquery file plus -vsdoc.js. I say that because the latest version of jsdoc to download from jquery site ends with vsdoc2.js which you need to convert to jsdoc.js to work. Moreover to use the minified version of jquery, you will need to remove min part from the name.
- Sometimes, the intellisense doesn’t work immediately so you may need to give a carriage return to start writing on a new line so that Visual Studio can bring you intellisense. So whenever you get this situation, you may close and reopen your page or js file and start writing on a new line. I don’t have a logical explanation for this situation but I have come across it several times and that’s how it worked out with me.
Below are some reference articles that provide more explanation and that you will find are great:
This post is on CodeProject.