neoclide / coc-prettier

Prettier extension for coc.nvim.
MIT License
546 stars 48 forks source link

Folds modified after formatting #174

Open nullromo opened 8 months ago

nullromo commented 8 months ago

Summary

After coc-prettier is triggered, the folding in the file will change

Steps to Reproduce

  1. Start with the following file:
export const f = () => {
    const x = () => {
        console.log('hello');
    };

    return 'a';
};
  1. :set foldmethod=indent
  2. :set foldlevel=99
  3. 2GJJ
  4. Trigger coc-prettier
  5. Notice that it looks like the original. This is the expected behavior. ✅
  6. zM2GzO
  7. 2GJJ
  8. Trigger coc-prettier
  9. Notice that the function is now folded. This is not what I want ❌

Ideal Solution

When formatting with Prettier, coc-prettier should not change any of the folding. It should not open or close any folds.