防止 Visual Studio Code 中的自动分号

Taf*_*man 4 css autocomplete visual-studio-code

我正在使用 Visual Studio 代码。我不想在 CSS 属性后面加上自动分号。但 VS Code 给了我一个我不喜欢的自动完成选项。

如何停止 CSS 属性末尾的自动完成分号?

小智 8

  1. 设置 > 扩展 > CSS ,取消选中带有分号的完整属性。

或者

  1. 您可以在设置编辑器中更改默认值。

搜索代码并将其从 true 更改为 false。

// Insert semicolon at end of line when completing CSS properties
  "scss.completion.completePropertyWithSemicolon": false,
Run Code Online (Sandbox Code Playgroud)

来自: https: //code.visualstudio.com/docs/getstarted/settings


小智 5

  1. 在 VSCode 中按 Control + Shift + P。

  2. 搜索 Preferences: Open Settings (UI)

  3. 再次在搜索栏中搜索Semicolon.

  4. 从要删除自动分号的地方选择 CSS 或您的首选语言。

  5. 取消勾选Insert semicolon at the end of line when completing CSS properties

你就完成了。