EeyoreLee / vscode-extension-yapf

Vscode formatter extension support for python files using `yapf`.
MIT License
18 stars 5 forks source link

Yapf formatting on type instead of on save #83

Open tomascsantos opened 1 year ago

tomascsantos commented 1 year ago

I have this installed and this is my settings.json:

image

When I type, formatting will start correcting my changes in a VERY annoying way. I love auto-format on save, but I would like to disable format on type, could you help me debug this? From my yaml I wouldn't expect this to be happening. Thank you!

lroling8350 commented 1 year ago

Running into a similar issue. It's not every key typed but instead everytime I hit enter if fires the formatter

lroling8350 commented 1 year ago

Was able to fix this by adding "editor.formatOnType": false to the python section like so

"[python]": {
    "editor.formatOnType": false,
tomascsantos commented 1 year ago

You are a scholar and a saint, thank you so much for that workaround

EeyoreLee commented 1 year ago

@lroling8350 @tomascsantos - hi, I noticed some users didn't need the feature formatOnType, also for me. The default value of formatOnType was overrided by Pylance to change to true cause it need the feature to do somethings. Do you think if I add a new knob that turn-off this feature by default like yapf.formatOnType will be better ? But for some users need this feature will set both setting yapf.formatOnType and editor.formatOnType to true.