Anthony Potts
Anthony Potts

Reputation: 9160

IntelliSense for Ajax and JavaScript libraries in Visual Studio

I know about using a -vsdoc.js file for IntelliSense, and the one for jQuery is easy to find. What other JavaScript, Ajax, and DHTML libraries have them and where can I find those files? Also, is there a document which outlines the specifications for -vsdoc.js files?

Upvotes: 8

Views: 4002

Answers (4)

Adam
Adam

Reputation: 28858

An excellent blog posting from Betrand LeRoy on IntelliSense format for JavaScript: The format for JavaScript doc comments.

In a nutshell:

Summary - used to describe a function/method or event. Syntax:

<summary locid="descriptionID">Description</summary>

Parameter - describe a parameter to a function/method. Syntax:

<param name="parameterName"
    mayBeNull="true|false" optional="true|false"
    type="ParameterType" parameterArray="true|false"
    integer="true|false" domElement="true|false"
    elementType="ArrayElementType" elementInteger="true|false"
    elementDomElement="true|false"
    elementMayBeNull="true|false">Description</param>

The param tag is used to describe the parameters of a method or constructor. The param tags should be in the same order as the method or constructor's parameters and have the same names.

Function return type - syntax:

<returns
    type="ValueType" integer="true|false" domElement="true|false"
    mayBeNull="true|false" elementType="ArrayElementType"
    elementInteger="true|false" elementDomElement="true|false"
    elementMayBeNull="true|false">Description</returns>

Value type - describes a property (shouldnt use 'summary' for a prop) - syntax:

<value
    type="ValueType" integer="true|false" domElement="true|false"
    mayBeNull="true|false" elementType="ArrayElementType"
    elementInteger="true|false" elementDomElement="true|false"
    elementMayBeNull="true|false"
    locid="descriptionID">Description</value>

Field - used to describe a field in a JavaScript class - syntax:

<field name="fieldName" type="FieldType"
    integer="true|false" domElement="true|false" mayBeNull="true|false"
    elementType="ArrayElementType" elementInteger="true|false"
    elementDomElement="true|false" elementMayBeNull="true|false"
    locid="descriptionID">Description</field>

How to include IntelliSense for an external JavaScript file, the following syntax as the first line(s) in a JavaScript file:

<reference path="path/to/the/script/reference.js"
    assembly="Assembly.Name" name="ScriptResourceName.js"/>

Upvotes: 13

Luke Page
Luke Page

Reputation: 41

I wrote on article to sum up (from investigation) what parts of vsdoc are used to help Intellisense in VS 2010 : http://www.scottlogic.co.uk/2010/08/vs-2010-vs-doc-and-javascript-intellisense/

Upvotes: 4

Sky Sanders
Sky Sanders

Reputation: 37084

Some guy built a very nice vsdoc for Google Maps V3. I use it, it works well. ;-)

Upvotes: 0

fakedarren
fakedarren

Reputation:

You can find Intellisense for MooTools here: http://code.google.com/p/mootoolsintellisense/downloads/list

Upvotes: 0

Related Questions