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

bkaid picture bkaid · May 6, 2011 · Viewed 10.4k times · Source

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?

Answer

Kyle Trauberman picture Kyle Trauberman · May 7, 2011

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