如何使 vscode 自动完成 HTML 标签的属性带有单引号?

Esc*_*707 7 html visual-studio-code

由于我更喜欢​​ HTML 中的单引号,因此如何配置 VScode 编辑器以使用单引号自动完成 HTML 标记的属性值字符串?

我尝试过安装Prettier和设置"prettier.singleQuote": true

或设置

"javascript.preferences.quoteStyle": "single",
"typescript.preferences.quoteStyle": "single"
Run Code Online (Sandbox Code Playgroud)

或设置配置Emmet

"emmet.syntaxProfiles": {
    "html": {
        "attr_quotes": "single"
    }
}
Run Code Online (Sandbox Code Playgroud)

但这些选项不会影响 HTML 自动完成。

因此,当我输入类似:<meta charset=并点击EnterVScode 时,将以双引号完成:

<meta charset=""
Run Code Online (Sandbox Code Playgroud)

如何获得结果,例如:

<meta charset=''
Run Code Online (Sandbox Code Playgroud)

Mar*_*ark 4

Insiders v1.62 中刚刚合并了一个新设置:

html.completion.attributeDefaultValue

与选项:empty | singleQuotes | doubleQuotes

doubleQuotes是默认值。

请参阅https://github.com/microsoft/vscode/pull/129284https://github.com/microsoft/vscode/commit/8d70e049dd1f15ce1f4a114c801b71aa9183c00b

属性引号设置 - 单引号、双引号或无引号