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?
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:
Another one:
Sometimes you'll also (in addition to what Kyle wrote) need to press Ctrl + Shift + J to update javascript intellisense in visual studio
精彩评论