Home>Article>Development Tools> How to format code in vscode

How to format code in vscode

hzc
hzc Original
2020-06-09 14:43:23 6863browse

How to format code in vscode

The method for vscode to format the code is:

First install Prettier -Code formatter in code[code formatter]

How to format code in vscode

How to format code in vscode

The second step is to open settings in the menu bar

How to format code in vscode

The third step is to search Search prettier

Click to edit in settings

How to format code in vscode

The fourth step is to add a statement to format the code when saving

"editor. formatOnSave": true

How to format code in vscode

If an error occurs, it may be that there is no comma at the end of the previous statement

Just add it

How to format code in vscode

Recommended tutorial: "vscode introductory tutorial"

The above is the detailed content of How to format code in 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