Skip to content

Automatic Typings Acquisition

Matt Bierner edited this page Jun 9, 2016 · 21 revisions

Starting with NTVS 1.2 for Visual Studio 2015, NTVS will automatically attempt to download typings for common Node packages in order to improve Javascript IntelliSense. These typings show up in the typings directory and in the tsd.json. They will also be included in your Visual Studio projects.

Automatic Typings Acquisition status bar

Downloading typings automatically enables a much better Intellisense experience for Javascript projects.

When Are Typings Automatically Acquired?

Types are automatically downloaded if all of the following are true:

  • You are using the NTVS 1.2 Alpha+.
  • You are on VS 2015 (not VS "15").
  • You have a Javascript project (not Typescript).
  • Intellisense mode is "ECMAScript 6".

Typings are automatically downloaded for all existing Node.js packages, as well as any new packages that are installed.

How are Typings Acquired?

Typings are automatically acquired by NTVS whenever a new Node package is installed. The typings are downloaded using TSD and placed into a typings folder in each project, similar to the node_modules folder. Optionally a tsd.json file can also be created to track which typings that are currently installed.

Additionally, in VS 2015, the typings files have to be included the Visual Studio project in order for them to actually be picked up by our new Typescript based language service.

🎵Note: You can add the typings directory to your .gitignore to exclude it from source control, but this file must stay in the Visual Studio solution. This file is are only required by the NTVS tooling and will be recreated if it is missing.

Configuring Automatic Typings Acquisition

You can configure or disable automatic typings acquisition by going to Tools -> Options and then Text Editor -> Node.js -> IntelliSense. Make sure you are in ECMAScript 6 IntelliSense mode.

Automatic Typings Acquisition options pane

Automatically add IntelliSense typings folder to Node.js projects

Should typings be downloaded automatically and included in your project?

Show status bar after adding new typings folder to project

Should NTVS show the yellow info bar in the solution explorer when typings are first added to a project?

Save changes to tsd.json config file

Should automatic typings acquisition create or update a tsd.json with information about which typings are installed?