Rich IntelliSense for jQuery

Rich IntelliSense for jQuery

  • Comments 73

Update: A new Hotfix is availble to complement this file.

A while back we updated VS2008 IntelliSense to not fail when referencing jQuery.  However, getting IntelliSense for chained calls and rich summary/parameter hints still required adding special comments to a few thousand lines of jQuery.  If you didn't have the time, you could download such a file from friendly members of the community such as James and Brennan.

As part of our new partnership with jQuery, yesterday we announced the availability of the official IntelliSense documentation file.  As you can see, our friends at jQuery have added a new download link for Visual Studio at http://docs.jquery.com/Downloading_jQuery#Download_jQuery.

image

You can also download the file directly from http://code.jquery.com/jquery-1.2.6-vsdoc.js.  As you might guess, this documentation file corresponds with the latest version of jQuery (which is currently 1.2.6).  While this file has a "js" extension, it's really just a documentation file.  You do not want to run this file in the browser.

How do I use this file (today)?

If you're inside an ASPX page, you will need to add the following lines of code into (normally) the head of your page:

image

Why do we have a server-side conditional statement?  IntelliSense disregards conditional statements of this type, and thus loads the "vsdoc" file (overriding the normal one).  At runtime the if (false) statement will ensure it this documentation file is not rendered (and executed) as script.  This trick allows the "switching" behavior you want.

If you're in a JavaScript file, use the normal file reference syntax to refer to the "vsdoc" file.

image

There's no need for tricks here since this comment is only meaningful to IntelliSense.

How do I use this file (in the near future)?

The ideal user experience should be one where you do not need special tricks as mentioned above.  Really, you shouldn't need to mention the "vsdoc" file name at all.  To that end, we plan on releasing a Hotfix that will enable this (stay tuned!).  Given normal references such as...

image image

...IntelliSense will opportunistically search for "jquery-1.2.6-vsdoc.js" and load that file instead.  Generally, given script name "x", IntelliSense will opportunistically search for "x-vsdoc.js".  If not found, it will then search for "x.debug.js".  You just need to make sure to place your "vsdoc" file next to the normal file.  Note, if you use jquery-1.2.6.min.js, you may need to rename the file to match the search pattern.

What are the advantages of this file?

One unique benefit of the file we have released is that it supports and understands jQuery plug-ins.  For example, given the plug-in below...

image

...you would see "myplugin" show up in IntelliSense.

image

We've noticed a few plug-ins do not work, and commonly this is because there is an IntelliSense incompatibility issue with the plug-in itself (as opposed to the jQuery documentation file).

Hope this helps!

Jeff King
Program Manager
Visual Studio Web Tools

  • If it is not working for you in your external js files and you've tried adding a tilde (~) make sure you use BACKslashes in the documentation location.

    ie: /// <reference path="~\js\jquery-vsdoc.js"/>

  • Mês passado eu postei sobre como a Microsoft está estendendo o suporte à jQuery . Nas últimas semanas

  • jQuery Intellisense in VS 2008 转自:http://weblogs.asp.net/scottgu/ Last month I blogged about how Microsoft is extending support for jQuery. Over the last few weeks we've been working with the jQuery team to add great jQuery intellisense support within

  • JQuery framework является одним из самых быстрых, удобных и простых для изучения. В данной статье будут

  • &lt;p&gt;jQuery has had a pretty significant release since DotNetNuke 5 was released.&amp;#160; If you want to upgrade jQuery now, here's how...&lt;/p&gt; ...

  • I’ve been reading a lot about jQuery lately (actually since last month) but more so lately because I

  • 【原文地址】 ASP.NET MVC 1.0 Release Candidate Now Available 【原文发表日期】 Tuesday, January 27, 2009 12:13 PM 今天

  • jQuery 1.3 was released a little over a month ago. The 1.3 release adds exciting features such as selector

  • It has been a little over a year since we shipped VS 2008 and .NET FX 3.5. Since then the team has been

  • Publicación del inglés original : Miércoles, 25 de marzo de 2009 a las 1:02 PST por Somasegar Hace poco

  • S. Somasegar, Senior Vice President Developer Division, has provided a catalog of developer tools that

  • 转帖:http://blogs.msdn.com/webdevtools/archive/2008/10/28/rich-intellisense-for-jquery.aspxAwhileba...

  • 上个月,我在博客里宣布了微软将对jQuery提供支持。在过去的几个星期里,我们与jQuery开发团队合作,在Studio2008和VisualWebDeveloper2008Expres...

Page 5 of 5 (73 items) 12345