您实际上如何更改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/