Closed ya5an closed 4 years ago
I have the same problem.
Versions IntelliJ IDEA 2019.3.3 (Ultimate Edition) Build #IU-193.6494.35, built on February 11, 2020 Runtime version: 11.0.5+10-b520.38 amd64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o Windows 10 10.0
Plugin version: 2.0.0
Hello! Thank you for opening this issue. We used to have a similar problem, see #114. I could never reproduce it. I'm leaving this bug opened, but I can't reproduce. Any help would be nice.
I can confirm some weird formatting behavior with this option enabled. I expect only changed lines to be reformatted or at most their immediate neighbors additionally. See the gif for an example of what actually happens
This gif
really sums it up. Random indentation changes in rows close to changed code. Often reformats the function right above an added one, if the code there was saved with indentation that doesn't match your specific code style.
Hello @yaeuge, thanks a lot for looking into this, I see what the problem is now. Unfortunately, the code that does the reformat isn't in the Save Actions Plugin, it is in JetBrains's source code (you can check where the processor is instantiated here: https://github.com/dubreuia/intellij-plugin-save-actions/blob/master/src/main/java/com/dubreuia/processors/GlobalProcessor.java#L31).
We have 2 choices here: either we open a bug report on Intellij's YouTrack (this issue is probably language based though, so this problem is for Java), or rewrite the ReformatCodeProcessor
so that it works better for your use case. PRs welcomed. Thanks
Closing as this is a JetBrains processor problem.
Does anyone know the ticket number of this with JetBrains or which version (if any) fixed this? Getting this on 2021.2.4 (Ultimate) still and don't want to update IntelliJ any further than necessary as to have a chance to not break other plugins/workflows.
The option Reformat only changed code(only if VCS configured) is not working. Reformatted not only changed lines. Sometimes the whole file is reformatted.
I use git
What triggered the plugin CTRL+S
Versions PhpStorm 2019.3.3 Build #PS-193.6494.47, built on February 12, 2020 Runtime version: 11.0.5+10-b520.38 amd64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o Linux 4.15.0-88-generic
Plugin version: 2.0.0