Home > Development Tools > VSCode > body text

How to automatically complete vscode

爱喝马黛茶的安东尼
Release: 2019-12-06 16:33:51
Original
9723 people have browsed it

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
Copy after login

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
Copy after login

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
Copy after login

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
Copy after login

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.
Copy after login
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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template