vscode代码无法缩进
VS Code 有两种折叠策略:一种是基于缩进(Indentation),一种是基于语言服务(Language Server)。有时候自动模式会失效。
解决方法:
- 打开设置 (
Ctrl + ,或Cmd + ,)。 - 搜索
folding strategy。 - 找到 Editor: Folding Strategy。
- 将其从
auto更改为 **indentation**。
- 注意:改为
indentation强制 VS Code 仅根据缩进层级来折叠,这对 Python 非常有效。
- 打开设置 (