JScript IntelliSense in Visual Studio Orcas

JScript IntelliSense in Visual Studio Orcas

Rate This
  • Comments 96

The March CTP of Visual Studio marks the debut of a much-requested and long-awaited feature: improved JScript IntelliSense.  We’ve been working on this for almost a year now and I’m pretty excited to finally be able to share it with the public.  There are a variety of topics I’d like to deep dive into, but for today let’s just take a quick aerial tour of the new features.

1. Proactive Completion List

Our old list was a bit lazy and only “awoke” when you typed a period while accessing a member.  Our new one is on-its-toes and is wired up to the language grammar.  Net effect: it comes up when you would expect it, and you can spend less time pressing ctrl+J. =)

2. Keywords in Completion List

In practice, you will spend half of your time typing keywords.  Now they’re part of the list.

3. ASP.NET AJAX Concepts in Completion List

We have new glyphs corresponding to objects and functions that have registered themselves as ASP.NET AJAX Namespaces, Classes, Interfaces, Properties, Enumerations, etc.  Since lists are usually long, this is particularly useful for quickly discovering that particular member you’re looking for.

The glyphs are aligned with the ones you would see in managed programming.  Vanilla fields and functions are now just marked as blue and magenta boxes respectively.

4. IntelliSense from Script Libraries for ASPX Pages

The cornerstone feature is the new ability to see objects and functions declared in external script files.  Note below that $addHandler was not defined in the current document:

How do we know which files you’re referencing?  We look for Script Managers (and Proxies), and infer what scripts it will bring into the page:

We look for the normal HTML script reference tags:

We also take into account any Master Pages that may contain any of the above.

5. IntelliSense from Script Libraries for JS Files

The example above works great for pages, but what if you’re in a JS file?  Since there’s no standard syntax, we decided on the following XML comment syntax (which you’ll see a parallelism in the next section):

The above declaration simply states that the current JS file should display IntelliSense including objects and functions declared in JScript1.js.  The following declaration references a script library embedded within an assembly (note the subtle usage of “name” instead of “path”):

If the “assembly” attribute is left out, we assume it to be the System.Web.Extensions assembly.  This keeps standard references to ASP.NET AJAX scripts succinct.

It’s worthwhile to remember that these declarations must be found at the top of the page before any script or any regular comments.  Additionally, these declarations are not used during the runtime in any way—they are for the editor only.

6. Enhanced Function and Parameter Tips

Function and parameter tips now have the ability to show ASP.NET AJAX type information as well as summaries.  This should help minimize context-switching when looking for documentation.  Tips appear both from the completion list:

…and underneath the function as you’re typing:

Where is this information coming from?  The editor simply reads the XML comments from the source code:

ASP.NET AJAX employs a XML documentation comment scheme akin to the .NET XML Documentation Comments.  As long as your sources are commented, we leverage them to display the additional information.  ASP.NET AJAX scripts and AJAX Control Toolkit scripts come in commented flavors.  For older files that don’t have these comments, we will still show at least the function name and parameter names.

7. Type Inferencing

A foundational feature enabling much of the IntelliSense is our ability to infer types across assignments between JScript variables—which are inherently type-less.  The JScript Team, our partner team, has a great post on this topic.  I’ll defer the discussion of this feature to them.

Summary

JScript IntelliSense is a (purposefully) subtle set of features.  I hope this introduction spotlights some of the functionality you might otherwise have missed and gets you up and running.  I’ll blog in more depth later.  For now, have fun playing with the March CTP and let us know what you think!

Jeff King
Program Manager
Visual Studio Web Tools

Leave a Comment
  • Please add 5 and 6 and type the answer here:
  • Post
  • 其中一个殷切期盼的特性是Visual Studio Orcas对客户端Javascript Intellisense的支持(这个特性在免费的Visual Web Developer Express版本中也工作)。

  • one thing that would be good is support for object oriented javascript i.e., javascript classes.  Same as I can use Class View for .net classes, i'd like to be able to use it for javascript classes.  Also a wizard for creating javascript classes would be good since the syntax is so screwy it takes me a while to get the syntax right - since javascript is not strongly typed it makes it harder.

  • Over the last week or so our team has been planning what we will be working on over the next 12 months.

  • 我打算把一些學習 ASP.NET AJAX 時的一些小範例貼上來,一方面做個簡單記錄,一方面,或許有人會覺得有用(其實網路上的教學文章很多了,你可以多找一些來看,會學得更多更快)。由於都是些簡短的小練習,故取名「牛刀小試」,ASP.NET AJAX 的應用技巧相當多,若有時間,我會盡量多寫幾篇,把它當作一個系列來寫。

  • Navegando y navegando, me encontre con este interesante blog, nos habla de como hacer el debugging de

  • In a previous post , I described the steps you can take to upgrade your existing ASP.NET AJAX 1.0-based

  • In a previous post , I described the steps you can take to upgrade your existing ASP.NET AJAX 1.0-based

  • Previous release of Visual Studio "Orcas" debuted the much awaited feature of Javascript intellisense.

  • I am simply amazed at the JavaScript debugging with Visual Studio 2008. The really cool part is that

  • Forget being the best thing since sliced bread – this is the best thing ever . Well maybe not quite that

  • Forget being the best thing since sliced bread – this is the best thing ever . Well maybe not quite that

  • Using VS 2008 to target ASP.NET AJAX 1.0

  • 原文地址:http://blogs.msdn.com/webdevtools/archive/2007/07/30/using-vs-2008-to-target-asp-net-ajax-1-0.a...

  • It should be no surprise that JScript Documentation Comments power much of what you see in JScript IntelliSense

  • It should be no surprise that JScript Documentation Comments power much of what you see in JScript IntelliSense

Page 6 of 7 (96 items) «34567