You can also hit
CTRL+SPACE and get intellisense.
If you hover over a variable VSCode shows the signature of a function or the type of a variable, if it can be determined.
Visual Studio Code Series
Follow this series to learn more about what you can do with Visual Studio Code!
- Introducing Visual Studio Code
- Getting Started with Visual Studio Code
- Git Integration and Preferences
angular? Put your cursor on it then click the light bulb ( or
CMD+. ) and choose
Add /// reference to angularjs/angular.d.ts.
VSCode will go and get the typings definition file for Angular and add it to your project, reference it in the file and you instantly have intellisense for Angular! (VSCode grabs the typings files from the Definately Typed repository.)
We can now repeat this by adding jQuery code to a file. Put the cursor on the
CMD+., and pull down the typings file. Now we have jQuery intellisense, too.
Consolidating into a tsd.d.ts
Do you see the 2
/// references and how the can accumulate? You can make a single
tsd.d.ts with the npm package named
npm install tsd -g # cd to your project folder tsd query -r -o -a install angular jquery
This produces a
I think the story for this will get even better too, since VSCode uses TypeScript under the covers for its tooling.
The intellisense and editor experience is top notch when using TypeScript. VSCode provides intellisense across multiple files because TypeScript understands the
VSCode provides intellisense for third party libraries, if you include the typings
Intellisense works in well known JSON files too, including
bower.json. It uses schema information and looks up values to find likely matches, where possible.
Here you can see it finding all npm packages that match
Here you can see it finding the most appropriate versions and showing a message about what the versions mean.