Rich IntelliSense on jQuery ajax() function
IntelliSense based on JSDoc
When the default type inference does not provide the desired type information, type information may be provided explicitly via JSDoc annotations. For example, to give a partially declared object a specific type, you can use the
@type tag as shown below:
This is also very useful for specifying parameter information. Using the JSDoc
@param tag you can add types to function parameters like so:
See this doc on github for the JSDoc annotations currently supported.
IntelliSense based on TypeScript Declaration Files
.d.ts files, and the most common repository for such definitions is on DefinitelyTyped. Behind the scenes, Visual Studio will use these
.d.ts files to enrich your IntelliSense.
.d.ts files. These files are downloaded to a cache located under the user folder at
%LOCALAPPDATA%\Microsoft\TypeScript. (Note: This feature is disabled by default if using a
tsconfig.json configuration file
Currently auto-detection works for dependencies downloaded from npm (via reading the
package.json file), Bower (via reading the
jquery-1.10.min.js in your project, the file
jquery.d.ts will be fetched and loaded. This
.d.ts file will have no impact on your project other than providing better completions, signatures, and contextual help.
ES6 and JSX Syntax Support
ES6 syntax in Visual Studio 2017 RC
In addition to official language updates, there are also unofficial language extensions like JSX, an XML-like extension that is popular in React development, that call for more flexible syntax support. Visual Studio 2017 supports both jsx and tsx file extensions as well as JSX syntax dropped directly in JS and TS files.
JSX syntax in Visual Studio 2017 RC
In addition to language specific improvements, you will also benefit from several general code navigation improvements. Go To, a completely new navigation feature, allows you to quickly perform complete searches to find types, functions, files, and more. Results can be filtered down based on category, to provide a single location for fast code navigation.
Navigation with Go To (ctrl + t or ctrl + ,)
When working with large projects or libraries, often the number of results in completion lists can get quite large. To help you quickly cut down the size of these lists, you can now filter the completion lists by categories such as functions and properties. All of these filters can be quickly toggled with logical hotkeys, which can be easily discovered by hovering over the filter button icons in IntelliSense.
IntelliSense filtering on functions (alt + m)
To read more about the above improvements and get an overview of all the general productivity improvements coming in Visual Studio 2017, check out this post by Mark Wilson-Thomas on Productivity Improvements in VS 2017 RC.
|Bowden Kelly, Program Manager, VS Client