Rauf
Rauf

Reputation: 12842

javascript intellisense in Visual Studio

  1. How can I get JavaScript IntelliSense in Visual Studio 2008 and in Visual Studio 2010 ?
  2. How can I get jQuery IntelliSense in Visual Studio 2008 and in Visual Studio 2010 ?
  3. If I fail to get the above, let me know 'Which is the most used JavaScript Editor which can replace VS versions for editing javascript files?

Upvotes: 5

Views: 8068

Answers (6)

DRobertE
DRobertE

Reputation: 3508

Go to Tools-Options-Text Editor-Javascript-Intellisense-References and place a reference to the intellisense files for the version of jquery you are using in the Implicit Web group.

OR

place an "add reference" to the intellisense file in the _references.js file which you can add to the Scripts folder of your project.

/// <reference path="jquery-1.8.2.js"/>
/// <reference path="jquery-1.8.2.min.js"/>
/// <reference path="jquery-1.8.2.intellisense.js"/>

Though this will only provide intellisense for the project you are in, the first will for any open js file.

To get the latest jquery files with intellisense use the nuget package installer which by default will create a scripts folder and place the jquery version.js, the min.js and intellisense.js files into... from there you can copy them to the location most of the Microsoft references are placed which is typically

C:\Program Files (x86)\Microsoft Visual Studio 11.0\JavaScript\References

Upvotes: 4

harsimranb
harsimranb

Reputation: 2283

You should get the jQuery files from Asp.Net CDN. They have VSDOC and are able to give very good intellisense and documentation support.

Upvotes: 0

Bek Raupov
Bek Raupov

Reputation: 3777

or you can simply drag and drop your javascript into your .js file and it creates entry like this:

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

worked fine on my VS 2010 (Premium version)

Upvotes: 12

Rauf
Rauf

Reputation: 12842

http://archive.msdn.microsoft.com/KB958502/Release/ProjectReleases.aspx?ReleaseId=1736

Wow... I followed the method described above.. Awesome....

enter image description here

Upvotes: 1

lox
lox

Reputation: 1622

  1. VS 2008/2010 has built in JavaScript IntelliSense.
  2. If you have the corresponding "-vsdoc.js" file next to your jQuery file VS 2010 offers IntelliSense out of the box and VS 2008 needs SP1 installed and the patch at http://code.msdn.microsoft.com/KB958502/Release/ProjectReleases.aspx?ReleaseId=1736
  3. No need, really.

Upvotes: 3

Igor Dymov
Igor Dymov

Reputation: 16460

I'm using VS2010 with ReSharper 6 which adds powerful JS Intellisense support. Autocomplete works for all JS files in the solution as well as jQuery. But it's not free.

Upvotes: 6

Related Questions