gpt4 book ai didi

formatting - VSCode:如何在保存时自动格式化?

转载 作者:行者123 更新时间:2023-12-04 17:15:21 27 4
gpt4 key购买 nike

在Visual Studio Code中,保存文件后如何自动格式化源代码?

最佳答案

通过设置启用“保存时格式化”

"editor.formatOnSave": true


您还可以仅针对一种特定语言进行设置:

"[python]": {
"editor.tabSize": 4,
"editor.insertSpaces": true,
"editor.formatOnSave": true
},


从1.6.1版开始,Vscode支持“保存时格式化”。它将自动使用相关的已安装格式化程序扩展名来格式化整个文档。

关于formatting - VSCode:如何在保存时自动格式化?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50606758/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com