Use of vs Code (I) format on paste / format on save / format on type

Posted on

Many classic questions can be searched out, but some very small questions have no answers on the Internet

(this is the most maddening. It’s so simple that there’s no relevant information on the Internet.)

(for example, I want to format automatically after saving, but most of the Internet is how to cancel the format automatically after saving. I’m really angry.)

In fact, I found that I’m getting a little started. It’s not a problem to solve these problems

I began to slowly look at the settings in vs code, check one by one and then look at them settings.json The changes in it and the actual effect

Problems in code formatting with vs Code

Format On Paste/Format paste

Format On Save/Format the saved file

Format On Type/Format the information you type(When you type a line, you type“;”Semicolon end line)~~~~
**
Let’s talk about what this format means**

Formatting can help you align, indent, split brackets, etc

It’s just that different formatting standards lead to different formatting effects

In theory, after checking the following three, I want the effect to have
Use of vs Code (I) format on paste / format on save / format on type~~~~

However, after Ctrl + s, I failed to format successfully, but I got a prompt like this

Use of vs Code (I) format on paste / format on save / format on type~~~~

I didn’t understand the meaning of this sentence, and then I turned it into an English version, so that I could go to Baidu
Use of vs Code (I) format on paste / format on save / format on type

But I still haven’t found a solution~~~~
Until I looked at it settings.json There’s a code I didn’t understand

Use of vs Code (I) format on paste / format on save / format on type

Then I found it in the settings, and I understood that if I chose null, it would be the same as using the compiler’s own formatter. If I didn’t choose null, it would be executed with its own formatter (obviously, first of all, there must be its own formatter, I don’t have one, so the “configuration file” cannot be formatter)

Change it to null and it’s done

Use of vs Code (I) format on paste / format on save / format on type~~~~

Leave a Reply

Your email address will not be published.