Home  >  Article  >  Development Tools  >  How to automatically complete vscode

How to automatically complete vscode

爱喝马黛茶的安东尼
爱喝马黛茶的安东尼Original
2019-12-06 16:33:519673browse

How to automatically complete vscode

Auto-completion (intelligent prompt)

Because Microsoft previously launched the typescript language, combined with tsd files, use It is quite fun to write TypeScript code in Visual Studio, and the smart prompt function is very nb.

This function should be inherited by vsc.

vsc’s auto-completion uses typings.

The TypeScript Definition Manager (the previous tsd has been deprecated, as explained in the faq)

https://github.com/typings/typings

It is very similar to npm Like, is there any?

The current mainstream front-end class libraries/frameworks, including node.js and its modules/frameworks, have corresponding tsd files. You can find them on typings.

Then you can install typings and use

npm install typings --global
cd vsc-doc
typings install dt~node --global --save
typings install express --ambient --save

which is very similar to npm, is there any idea?

Look at the current directory at this time. The express.d.ts file below is used for specific prompts.

typings/express/express.d.ts

In the code editing area, enter CTRL SPACE (default shortcut key) to get a prompt.

How to automatically complete vscode

The current version of node.d.ts is still 0.12.0, which is not much different from the API of node v4 (the latest one is already 4.x)

Why is there no code prompt?

In the directory of package.json

typings install node --ambient --save

Then add comments to the app.js file, quote typings, and then there will be code prompts.

/// <reference path="typings/node/node.d.ts"/>
var http = require("http")
// http.
http.cr

The specifics are as follows:

How to automatically complete vscode

##You can also hit CTRL SPACE and get intellisense.

If you change it repeatedly, you still can’t prompt (After I got it working, I deleted jscongfig.json, and then vsc never prompted me, no matter what I did), please restart.

Why not use tsd?

https://github.com/DefinitelyTyped/tsd

The official said:

DEPRECATED: TSD is deprecated, please use Typings and see this issue for more information.

PHP Chinese website has a large number of free

vscode introductory tutorials, everyone is welcome to learn!

The above is the detailed content of How to automatically complete vscode. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:How to wrap vscodeNext article:How to wrap vscode