Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Have you ever gotten jquery vsdoc file to work with Visual Studio?

Tags:

I assume the point of the jquery vsdoc file is to provide some form of intellisense for jquery. I have used Visual Studio & jQuery & ASP.NET MVC for a while but I have never once seen it work in action. I don't know if: 1) I'm misunderstanding the purpose of the jQuery vsdoc file, 2) it doesn't work when you use jQuery from the Microsoft CDN, 3) Resharper is conflicting (I am using 6 now but it didnt work with 4,5 either) or 4) someother extension I have is causing it to not to work.

My question: is any form of jQuery intellisense possible with Visual Studio 2010, and if so, can you post a screenshot of what it looks like?

like image 516
bkaid Avatar asked May 06 '11 21:05

bkaid


2 Answers

Just having the vsdoc file present isn't enough to enable intellisense. You need to reference the file in your page (wrapped in if(false) to prevent the reference from being rendered to the client):

<% if(false)  { %>     <script src="/path/to/vsdoc.js" type="text/javascript"></script> <% } %> 

or at the top of your .js file:

/// <reference path="/path/to/vsdoc.js" /> 

EDIT: a screenshot: jQuery Intellisense

Another one:

jQuery Intellisense

like image 200
Kyle Trauberman Avatar answered Nov 14 '22 09:11

Kyle Trauberman


Sometimes you'll also (in addition to what Kyle wrote) need to press Ctrl + Shift + J to update javascript intellisense in visual studio

like image 32
Marek Avatar answered Nov 14 '22 07:11

Marek