Click here to Skip to main content
13,597,589 members
Click here to Skip to main content
Add your own
alternative version


7 bookmarked
Posted 20 Apr 2010
Licenced CPOL

Use IntelliSense in JavaScript Files

, 6 Jul 2010
Rate this:
Please Sign up or sign in to vote.
Leverage VSDoc and DEBUG file documentation in VS2010
By adding a simple reference tag to your JavaScript files you can enable IntelliSense support for external files in Visual Studio 2010 (most functionality is also available in Visual Studio 2008).

For example, the following line will add IntelliSense for jQuery for a script located in the same directory:

/// <reference path="jquery-1.4.1.js" />

You can also have the IDE create this tag for you automatically (with the correct path) by dragging scripts into the file you're working on.

This gives you the basic IntelliSense - like code completion, object members and method signatures. VS2010 is also able to determine members exposed through closures as well as through any prototype methods.

If you also put a VSDoc file (or a debug file with the "dot debug" convention) in the same directory, you get full IntelliSense with summary information for functions and parameter type information. You needn't reference this file, you simply need to have it beside your production version. Visual Studio will look first for a -vsdoc.js file, then a .debug.js file, then finally the file you've referenced (in this case, jquery-1.4.1.js.

Instead of using the local copy, you can also reference a script out on the cloud, such as jQuery hosted on Microsoft's CDN. Visual Studio 2010 will also look there, to see if any of the conventions for documentation exist at that address. (Visual Studio 2008 can only do this on local files).



This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Software Developer (Senior)
Canada Canada
For almost 30 years I have been working with computers, learning a myriad of languages and participating in various computing environments.

Though I have been mentoring other developers for the last decade, I have recently found a strong interest in writing and am learning to translate the fun of in-person teaching to something I can get into article form.

I enjoy following technology trends, new gadgets and trying to guess where innovation will lead us next (I'm kinda holding out for a robot-served utopia, but willing to submit to our future robot leaders).

I am a guy who is passionate about my faith, my family and a cure for Juvenile Diabetes (my son lives with this disease).

You may also be interested in...


Comments and Discussions

QuestionThanks for sharing Pin
Hector Pacheco29-Aug-14 3:24
memberHector Pacheco29-Aug-14 3:24 
GeneralHi, Antoun, I updated for information on 2008. Cheers! Pin
TheyCallMeMrJames6-Jul-10 14:30
memberTheyCallMeMrJames6-Jul-10 14:30 
GeneralWhat about VS 2008 ? Pin
Antoun Gorgy6-Jul-10 3:20
memberAntoun Gorgy6-Jul-10 3:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Cookies | Terms of Use | Mobile
Web02-2016 | 2.8.180621.3 | Last Updated 6 Jul 2010
Article Copyright 2010 by TheyCallMeMrJames
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid