当我换行时,格式化程序会表现一种方式
例如:
a=1+2
-> a = 1 + 2
但是当我按下保存按钮时,格式化程序的行为会有所不同
例如:
a=1+2
-> a = 1+2
我正在使用默认的'autopep8'
我希望“保存时格式化”的行为类似于“输入时格式化”
答案 0 :(得分:0)
这是由于使用了不同的格式类型,文件的显示样式不同。
根据您的描述,建议您在输入“ "python.formatting.blackPath": "black",
”后使用"python.formatting.autopep8Path": "autopep8",
而不是a=1+2
,其效果与
"editor.formatOnType": true,
:
参考:Formatting。