1、原因:
vscode默认启用了根据文件类型自动设置tabsize的选项
2、解决方法:
因此,可以通过关闭自动设置选项,防止格式覆盖。
3、如何操作
在用户设置里添加如下配置即可: "editor.detectIndentation": false
"editor.detectIndentation": false
file->preferences->settings 搜索detect indentation
detect indentation
如图:
上一篇:vscode如何设置python代码中函数括号自动补全
下一篇:vscode如何设置护眼主题