I'm not sure I understand how the intellisense works for Microsoft's new vsCode text editor. In the docs under the "Great Code Editing Experience" heading, it shows a warning under the node global variable __dir
and offers a lightbulb suggestion to add a reference to a d.ts file so you can get intellisense for node:
I have 2 questions:
1 - How do I import DefinitelyTyped files (d.ts) directly (without editor suggesting it) or do I have to copy them from the github source and put them in a typings directory?
2 - Can I get intellisense for any library that has a typescript definition? I tried the below, but when I type in express.
or when.
, I don't get any intellisense. However, I do get node intellisense.
/// <reference path="../typings/node/node.d.ts"/>
/// <reference path="../typings/express/express.d.ts" />
var when = require('when')
, express = require('express')
, gulp = require('gulp')
See Question&Answers more detail:os