对于 JavaScript 格式化程序工作正常,但不适用于 Python。我已经安装了 autopep8 但似乎无法设置最大行长度。我试过这个:
"python.formatting.autopep8Args": [
"--max-line-length",
"79",
"--experimental"
]
Run Code Online (Sandbox Code Playgroud)
我的 settings.json 看起来像这样:
{
"workbench.colorTheme": "One Dark Pro",
"git.autofetch": true,
"workbench.iconTheme": "material-icon-theme",
"git.enableSmartCommit": true,
"terminal.integrated.shell.windows": "C:\\WINDOWS\\System32\\cmd.exe",
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[html]": {
"editor.defaultFormatter": "vscode.html-language-features"
},
"javascript.updateImportsOnFileMove.enabled": "always",
"[javascriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"liveServer.settings.donotShowInfoMsg": true,
"editor.formatOnSave": true,
"window.zoomLevel": 1,
"vscode-w3cvalidation.validator-token": "Fri, 07 Aug 2020 07:35:05 GMT",
"python.formatting.provider": "autopep8",
"python.formatting.autopep8Args": [
"--max-line-length",
"79",
"--experimental"
],
"python.autoComplete.addBrackets": true,
"python.autoComplete.extraPaths": []
}
Run Code Online (Sandbox Code Playgroud)
有什么想法如何解决这个问题吗?