Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 361
Anthony Potts Avatar asked Nov 11 '08 21:11

Anthony Potts


People also ask

Does Visual Studio support IntelliSense?

Powered by a TypeScript based language service, Visual Studio delivers richer IntelliSense, support for modern JavaScript features, and improved productivity features such as Go to Definition, refactoring, and more.

How do I turn on VS in IntelliSense?

To access this options page, choose Tools > Options, and then choose Text Editor > C# > IntelliSense.

What is JavaScript IntelliSense?

Visual Studio Code's JavaScript IntelliSense provides intelligent code completion, parameter info, references search, and many other advanced language features. Our JavaScript IntelliSense is powered by the JavaScript language service developed by the TypeScript team.


2 Answers

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"/>
like image 136
Adam Avatar answered Sep 27 '22 18:09

Adam


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/

like image 41
Luke Page Avatar answered Sep 27 '22 19:09

Luke Page