It appears that Orcas does fine with any straight function and variable definitions. If I have an ASPX page or a backing .js file and all I have in there is plain functions as is often the case with front end UI code I get Intellisense on this functionality.
So I set up a a sample JS file that checks for different class formats and how the Intellisense works for them. I created a simple ASPX page and added a reference to a script file. The comments indicate whether the structure is visible to Intellisense.
And then created the JS file with the following:
// this works fine
alert("Hello " + name);
// Class as closure - doesn't work
this.myProperty = "Test";
this.myProperty2 = 0;
this.myMethod = function(input)
// JSON static Class syntax - works
var MyStaticClass2 =
// Prototype syntax - works
// <value type="number" ></value>
// *** Additional Prototype assignments - works
MyClass3.prototype.myProperty3 = 3;
// *** Direct property assignment - doesn't work
MyClass3.myProperty4 = 4;
I might be missing other ways here - if you see one of those leave a comment and I'll add it here. It seems it would be good to know what does and doesn't work.
So it looks like Orcas supports only prototype assignment syntax to figure out what 'members' are available on a class. It doesn't try to deal with direct class instances - maybe understandably so because it gets pretty difficult to determine when a property is assigned otherwise.
Further, if I'm inside the actual test.js file and in a method of a class (even one that is externally visible to Intellisense) I still don't get Intellisense on the this. pointer.
Syntax Parsing Errors make Intellisense fail entirely
It seems if there is any sort of syntax error or something that the Orcas Intellisense parser doesn't understand the entire Intellisense for the page comes to a stop. For example, if I add Prototype.js to the same page that loads the Test.js file, the Intellisense for Test.js and even functions in the local page file stops working. Not sure if that's intended behavior or a bug at the moment.
I suppose it's disappointing especially since I've been using Aptana, which does all of this fine, but of course it lacks the Visual Studio integration. For reference, here's a screen shot of typing this. inside of the test.js class in the Aptana editor:
Notice that in Aptana all three of the classes are visible and Intellisense picks up internal members within classes. It also recognizes closure based classes (although for some odd reason the plain HelloWorld function is missing) and figures out assignments in code in most cases.
Another extremely helpful feature that I wish was available in Visual Studio is the Function/Class list. The Outline window in Aptana is probably the main reason I use it - it let's me navigate large JS documents and classes. There's nothing like this in Visual Studio 2008 yet I think this is a crucial feature.
Hopefully there's more to come in coming betas.