Skip to content
This repository has been archived by the owner on Dec 24, 2020. It is now read-only.

coc formatter deleting lines when formatting sometimes #313

Open
himat opened this issue Nov 21, 2020 · 1 comment
Open

coc formatter deleting lines when formatting sometimes #313

himat opened this issue Nov 21, 2020 · 1 comment

Comments

@himat
Copy link

himat commented Nov 21, 2020

For some reason, sometimes, the auto formatter is deleting entire functions in my python files!

I save inside vim with :w, and then it auto formats with black, but then sometime a function or class might just be deleted.

It doesn't happen all the time though, just randomly, and I'm unable to reproduce this.
But this is making it very dangerous for me to even use the auto formatter even though it's very helpful.

Here is my .vim/coc-settings.json file

{
    eslint.filetypes: [javascript, javascriptreact, typescript, typescriptreact],
    coc.preferences.formatOnSaveFiletypes: [python],
    python.jediEnabled: false,
    python.formatting.provider: black,
    python.linting.pylintEnabled: false,
    python.linting.mypyEnabled: true,
    python.linting.enabled: true
}

Any suggestions on what to do here?

@himat
Copy link
Author

himat commented Nov 21, 2020

It seems this person had the same issue but with coc java: neoclide/coc-java#62

Is there a way to do what they did to fix it but for python?

@himat himat changed the title black formatter deleting lines when formatting sometimes coc formatter deleting lines when formatting sometimes Nov 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant