Your official information source from the .NET Web Development and Tools group at Microsoft.
Colorization, validation, IntelliSense, and formatting comprise the core of any modern editor. With VS 2008 SP1, we are completing the core JScript editor by introducing code formatting. Additionally, we have promoted JScript to a dedicated node in “Tools Options” providing a clean separation from the HTML “Tools Options”. We realize many folks have been waiting for this feature and we’re excited to be able to finally provide it.
We’re using “beta” period to fine tune the feature for final release. Thus, we would love to hear any feedback you have. There are two areas in particular I’d like to highlight:
At this point please feel free to just download the Service Pack and dive into the feature. If you're interested in the details of JScript Formatting and related options, please feel free to continue reading.
There are a couple of different methods available to invoke formatting. They can be invoked automatically while typing when any subset of the ‘Automatic Formatting’ options are checked. They can also be invoked via the ‘Edit / Format Document’ and ‘Edit / Format Selection’ menu items. Once invoked, all settings in the Formatting tab will be applied.
The JScript Formatting settings are available within four tabs under the new Tools / Options / Text Editor / JScript node. These four tabs are: General, Tabs, Formatting, and Miscellaneous, as seen below.
General and Tabs
The first two tabs are standard across all editors (including JScript). The settings found in these tabs are what we describe as Editor Level settings. This means that when JScript exists on a mark-up page, and the setting within the JScript node conflict with those on the equivalent HTML node; the settings on the HTML node will prevail. Although, most setting behave the same across all editors, there are a few items which need to be called out:
The third tab is custom made for JScript and contains the meat of the JScript Formatting feature. We will go into more detail as to what the settings mean and the affect they will have on JScript code.
Automatic formatting: This section refers to WHEN formatting will occur as the user is typing in and manipulating code in ‘real time’. Basically, formatting is being performed as the user is constructing the code.
New lines: This section refers to where braces will be inserted with regards to functions and control blocks
Spacing: This section refers to how spacing will be inserted (or taken out) when formatting is invoked via automatic formatting (as described above) or through an intentional invocation via ‘Format Document’ or ‘Format Selection’.
The final tab is specific for JScript and contains validation rules as well as statement completion options. The Validation section was removed from the Tools / Options / Text Editor / HMTL / Validation tab and given its own space under the JScript node; while the Statement completion section was taken from the Tools / Options / Text Editor / HTML / Miscellaneous tab.
We hope this gives you a complete picture of the various customizations possible and serves to make your JScript editing experience better! Once again, we look forward to any feedback you have to provide.
Nichole Baker and Jeff King SDET and Program Manager Web Tools
With Visual Studio 2008 RTM, JScript validation setting is an option on the HTML validation page on the