简体   繁体   English

在 Visual Studio Code 中防止自动分号

[英]Prevent auto semicolon in Visual Studio Code

I'm using the Visual Studio Code.我正在使用 Visual Studio 代码。 I never want auto semicolon after CSS properties.我从不想在 CSS 属性之后使用自动分号。 But VS Code gives me an auto-complete option which I don't like.但是 VS Code 给了我一个我不喜欢的自动完成选项。

How can I stop auto-complete semicolon at the end of CSS properties?如何在 CSS 属性末尾停止自动完成分号?

  1. Settings > Extensions > CSS, uncheck the Complete Property With Semicolon.设置 > 扩展 > CSS,取消选中带分号的完整属性。

or或者

  1. You can change the default values in the Settings editor.您可以在设置编辑器中更改默认值。

search the code & change it from true to false.搜索代码并将其从 true 更改为 false。

// Insert semicolon at end of line when completing CSS properties
  "scss.completion.completePropertyWithSemicolon": false,

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

In Settings go to Extensions -> CSS and uncheck 'Completion: Complete Property With Semicolon'Settings go 到Extensions - > CSS并取消选中“完成:用分号完成属性”

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

  2. Search For Preferences: Open Settings (UI) .搜索Preferences: Open Settings (UI)

  3. Again in the Searchbar, search for Semicolon .再次在搜索栏中,搜索Semicolon

  4. Choose CSS or your preferred language from where you want to remove auto semicolon.选择 CSS 或您要从中删除自动分号的首选语言。

  5. Untick Insert semicolon at the end of line when completing CSS properties . Insert semicolon at the end of line when completing CSS properties

And you are done.你完成了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM