Skip to content

Automatic Typings Acquisition

Matt Bierner edited this page Mar 31, 2016 · 21 revisions

Starting with NTVS 1.2 Alpha for Visual Studio 2015, NTVS will automatically attempt to download typings for common Node packages in order to improve the Intellisense experience. These files will show up as typings and a tsd.json file in the project's files and in the Visual Studio solution. 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 level is set to "ES6 Preview".

❗️Important: Automatic typing acquisition cannot be disabled on its own. It is an important part of our modern Intellisense experience in VS 2015. The only way to turn off this behavior is by switching you NTVS Intellisense level to something other than "ES6 Preview".

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. A tsd.json file is also created to track the 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 both the typings directory and tsd.json to your .gitignore to exclude them from source control, but they have to stay in the Visual Studio solution. They are only required by the tooling and will be recreated by NTVS if they are missing.