gpt4 book ai didi

whitespace - 如何在vscode中更改tabSize和insertSpaces

转载 作者:行者123 更新时间:2023-12-01 12:46:16 25 4
gpt4 key购买 nike

您实际上如何更改vscode的“editor.tabSize”和“editor.insertSpaces”值?我打开了文件>首选项>用户设置,并添加了:

// Place your settings in this file to overwrite the default settings
{
// Controls the rendering size of tabs in characters. If set to auto, the value will be guessed based on the opened file.
"editor.tabSize": 4,

// Controls if the editor will insert spaces for tabs. If set to auto, the value will be guessed based on the opened file.
"editor.insertSpaces": true,
}


但是,当我打开带有两个空格标签的html文件时,按tab插入两个空格,而当我打开使用\ t标签的文件时,按tab插入\ t。

我做错了什么导致vscode不尊重我的设置?

最佳答案

您的代码段中有一个逗号结尾,并且当前VSCode无法理解格式错误的JSON的设置。我很高兴地说,在下次更新中,此问题应已解决:)!

设置的有效版本为:

// Place your settings in this file to overwrite the default settings
{
// Controls the rendering size of tabs in characters. If set to auto, the value will be guessed based on the opened file.
"editor.tabSize": 4,

// Controls if the editor will insert spaces for tabs. If set to auto, the value will be guessed based on the opened file.
"editor.insertSpaces": true
}

关于whitespace - 如何在vscode中更改tabSize和insertSpaces,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30126059/

25 4 0
文章推荐: loops - 使用循环在 Jenkins 中使用构建流插件运行并行构建
文章推荐: java - 如何在生产者和消费者之间共享单个套接字?
文章推荐: java - 比较器 可打包