In Visual Studio 11 Beta, we have exciting JavaScript editing features for the developers. Last year, we blogged “JavaScript Web development differences between Visual Studio 11 Developer preview and Visual Studio 2010”. Here are the differences between Visual Studio 11 Beta and Visual Studio 2010.
IntelliSense
Description |
VS2010 Behavior |
Visual Studio 11 Beta Behavior |
Changed From VS11 Developer Preview |
ECMAScript 5 compliance |
No |
Yes. Visual Studio 11 Developer Preview fully supports ECMAScript 5. |
|
Auto-reducing Statement Completion List |
No |
Yes, if the IntelliSense is automatically enabled when typing. The following screen shots shows all the document’s statement completion items that contains character "al": |
|
Completion Hint shows function signature |
No |
Yes, making completion hint more helpful. |
|
IE DOM IntelliSense |
No, change DOM based on the current schema and is hard to upgrade. |
Yes, will get IntelliSense from IE10’s DOM, which is implicitly referenced (see the next item for how to change implicit reference files). |
|
Implicit references (js files that are always referenced for editor IntelliSense) |
No |
Yes, through tools->option->Text Editor->JavaScript->IntelliSense->References, "implicit (Web) " reference group for web projects and web sites. In VS11 Developer Preview, there is only one implicit reference group for both Windows and Web development. In VS11 Beta, they are separated to Implicit (Windows) and Implicit (Web) reference groups. The JavaScript references will be automatically loaded for intelliSense usage according to project types, for example metro style JavaScript/HTML project will use "implicit (windows)" reference group, and web site/web applications will use "implicit (web)" reference group. In VS11 Beta, all new web templates have scripts/_references.js file. This file needs to be updated if project script files names get changed. For example, if you change” jQuery.1.6.2.js” to “jQuery.1.7.1.js” in the project, the _references.js file content needs to be changed in order to get the jQuery intelliSense. |
Yes. |
Immediate feedback on undefined objects |
No |
Yes. We will show a list of all identifiers in the file when IntelliSense cannot determine the type of an object. The identifier list is recognizable by the use of a different icon next to each completion item and a tooltip indicating that all identifiers are being shown. |
|
Ctrl+Shift+J to rebuild IntelliSense |
Yes |
Local IntelliSense is now automatically rebuild. In VS11 Beta, Ctrl+Shift+J is used to refresh cached JavaScript files referenced from a remote site. The Refresh Remote References command will update the reference cache by downloading the latest version of referenced files from their remote location. This is new from VS11 Developer Preview. |
Yes |
named function expressions var a = function namedFunc() { //position 1 } //position 2 |
Show IntelliSense in both position1 and position2 due to inaccuracy of the engine. |
Better engine accuracy, only shows IntelliSense in position 2. The distinction is that named function expressions identifiers are only visible within the scope of the function expression itself. |
|
Script Loader dynamically add loaded JavaScript file as reference |
No |
Yes. Engine will take the dynamically loaded JavaScript for reference. There is a known issue in Beta that affects remote JavaScript file loading. For example, the following does not work correctly in VS11 Beta. It will be resolved in future release. <script type="text/javascript" |
XML Document
Description |
VS2010 Behavior |
Visual Studio 11 Developer Preview Behavior |
Changed From VS11 Developer Preview |
IntelliSense Signature overloading |
N/A |
New feature |
|
JavaScript XML documentation MSDN documentation |
No. A blog is used as reference: |
For VS 11 Beta, the MSDN JavaScript XML documentation specification is in http://msdn.microsoft.com/en-us/library/hh524453(VS.110).aspx Note, for field, param and var node, one attribute has not yet been added to the current MSDN preview documentation: value. It can be used to define some not-classed object s in the following example: function Chair3(type) { this.type = type; this.color = "red"; } Chair3.prototype.getInfo = function () { return this.color + ' ' + this.type + |
Yes |
Debug/Breakpoint
Description |
VS2010 Behavior |
Visual Studio 11 Beta Behavior |
F9 set on a line with multiple statement |
Select and break on whole line |
Select and break on the statement where cursor is on, making debugging compressed JavaScript files possible. |
Open remote extension-less JS files in JS editor |
No |
Yes, debug and step through the following will open jsapi in editor : <script src="https://www.google.com/jsapi" type="text/javascript"></script> <script type="text/javascript"> google.load("jquery", "1.6.0"); </script> |
MicrosoftAjax.js and other library Support
Description |
VS2010 Behavior |
Visual Studio 11 Beta Behavior |
Changed From VS11 Developer Preview |
MicrosoftAjax’s IntelliSense filter, glyph and other support |
Hard coded |
Supported via MicrosoftAjax.intellisense.js file, which is located in [ProgramFiles]Microsoft Visual Studio 11.0JavaScriptReferencesMicrosoftAjax.intellisense.js Note, In VS11 Developer preview, it was named MicrosoftAjax.vsextensions.js. |
Yes |
Editor display
Description |
VS2010 Behavior |
Visual Studio 11 Beta Behavior |
Outlining |
Through extension |
Supported |
Brace matching |
Through extension |
Supported |
Brace highlighting |
Through extension |
Supported |
Go to Definition (F12) |
N/A |
Supported |
Validation
Description |
VS2010 Behavior |
Visual Studio 11 Beta Behavior |
Regular expression |
No color coding, no validation |
With color coding and validation |
"use strict"; validation support (ECMAScript 5) |
No |
Yes |
Consistency with IE JavaScript syntax checking |
No |
Yes, the JavaScript syntax error you see in VS will be the same as you see in IE. |
Misc
Description |
VS2010 Behavior |
Visual Studio 11 Beta Behavior |
Changed From VS11 Developer Preview |
jQuery Templates script block support, show IntelliSense, coloring and indent. |
No |
Yes |
|
Sharepoint JS reference via http://site/SiteAssets/x.js |
No |
Yes <script type="text/javascript" src= |
|
Dom Explorer |
No |
Supported when debugging with IE10 only |
|
JavaScript Console |
No |
Supported when debugging with IE10 only |
|
Customized JavaScript Snippet |
Yes |
Yes. Note, VS2010 customer snippet file is not compatible with Visual Studio 11 Developer Preview. An attribute needs to be changed in each snippet file from "jscript" to "JavaScript" <Code Language="jscript"> … </Code> Change to <Code Language="JavaScript"> … </Code> |
|
Name across product |
Jscript |
JavaScript |
|
JavaScript editor Indenting/Tab setting usage |
both indenting/tab settings: * the HTML settings are used not matter how JScript is set when in Mark-up * the JScript settings are used no matter how HTML is set when in JS File |
Only tab settings: (indent settings are used according to the language) * the HTML settings are used not matter how JavaScript is set when in Mark-up |
Yes |
JavaScript smart indenting in tools->options->text editors->JavaScript->Tabs |
Block indenting as default, no smart indenting |
Smart indenting is the default Note, In Dev11 Developer Preview, block indenting is the default |
Yes |
Explicit /// reference in html/aspx/master/ascx files |
/// specified in markup page does not add reference |
/// also works in markup page’s script block. It has to be on the top most script block. It will be useful for user control JavaScript explicit references. Also useful in edges cases such as following require.js syntax: <script data-main="scripts/main" |
Yes |
In misc file project, JS file download remote reference (http reference) |
Allowed by default |
Disabled by default, with message in the output: Downloading of remote references for files in the miscellaneous files project is disabled. To enable downloading of remote references, check the appropriate option in Tools | Options | Text Editor | JavaScript | IntelliSense | General |
Yes |
_variable (with leading underscore) shows or not in the referenced file |
Default: Yes MSAjax: No |
Default: No MSAjax: No %VS11InstallationDirectory%JavaScriptReferencesunderscorefilter.js extension controls this. MSAjax extension controls it as well for MSAjax reference. You can remove the control if you don’t like this behavior from tools->option->Text Editor->JavaScript->IntelliSense->References, "implicit (Web) " reference group for web projects and web sites. |
Yes |
You feedback is very valuable for us. Please go to http://connect.microsoft.com/VisualStudio to let us know your issues and suggestions.
Best Regards,
Xinyang Qiu
Web Platform and Tools Team
0 comments