我正在尝试将我的python格式化程序设置为autopep8。它已正确安装,但从未在VSCode中作为格式化选项。
"python.formatting.autopep8Path": "C:\\Users\\DawsonSchaffer\\AppData\\Roaming\\Python\\Python39\\Scripts\\autopep8.exe",
"python.formatting.autopep8Args": [
"--max-line-length",
"160",
"--aggressive",
"--aggressive",
"--in-place"
],
"[python]": {
"editor.defaultFormatter": "autopep8",
},

我已经改变了所有的设置。然而,我不确定该为autopep8设置什么。
"[python]": {
"editor.defaultFormatter": "ms-python.python",
},
or
"[python]": {
"editor.defaultFormatter": "autopep8",
},此外,autopep8在控制托盘中不可用。

谢谢道森
发布于 2021-05-26 14:00:41
这是为了配置
"[python]": {
"editor.defaultFormatter": "ms-python.python"
},在settings.json中。
您可以像这样设置以应用autopep8格式:
"python.formatting.provider": "autopep8",
"editor.formatOnSave": true,
"files.autoSave": "afterDelay",https://stackoverflow.com/questions/67697045
复制相似问题