Javascript intellisense for your own library

Writing JavaScript can be tedious without intellisense. Here is a trick to get intellisense for your own libraries in Visual Studio 2010. For example your functions, variables are residing in file jslib.js. You want to refer them in Script1.js.

Write the below code in the first line of Script1.js. Alternatively you can drag and drop jslib.js file to first line of Script1.js to get this code.

/// <reference path=”jslib.js” />

// Script1.js code goes here

Press CTRL + SHIFT + J to update the JavaScript intellisense. Then start using the functions, variables in your Script1.js. Though you will not get full intellisense experience, it works most of the time.

sshot-346sshot-347sshot-348sshot-349

It seems to work in Visual Studio 2008/2010/2012, but I verified this in Visual Studio 2010 only. Here is a full length article written on this topic from MSDN.

http://msdn.microsoft.com/en-us/library/vstudio/bb385682(v=vs.100).aspx

Enjoy.

Leave a comment