Undesired unfolding after each save

Hello, working with vue project, each time i save any .js file - any parts i have folded got unfolded, i also lose custom folding regions I have defined. What is happening and how to stop it? I suspect it is something to do with ESLint. Thank you! 

2
9 comments

Do you have any "on save" actions configured? Please check Settings | Tools | Actions on Save

0

Removing to run Prettier on save has solved the issue. However, prettier is not being run now and the solution is only half satisfactory :/

0

Any ideas what might cause Prettier processing on SAVE to lose folding?

0

in this case the file is modified by external process, it's not clear how to preserve the folding state in such case

0

I have the same issue with prettier. And it is really annoying!

Ideas for your devs (guess they came up with these by themselfs):

  • I could think of a "state" for every collapsable area. PHPStorm saves the state before prettier and restores it afterwards.
  • Let PHPStorm (not prettier) do the formatting und just take the prettier format styles into account.
0
the issue is tracked at https://youtrack.jetbrains.com/issue/WEB-54228, please follow it for updates
2

uncheck 'Reformat code' and check 'Run prettier' in actions on save.
this solved my problem.

2

Jihoo94 Thank you, thank you, thank you! I have been annoyed by this since switching to WS a year ago. (I actually just changed the "Reformat Code" to "Only Changed", and it still worked)

0

Please sign in to leave a comment.