After I updated IntelliJ IDEA, it started to rearrange code before each git commit. I found rearrange rules in Settings > Editor > Code Style > Java but there is no checkbox for enable/disable feature.
How can I disable it?
In Preferences > Editor > Code style > [language] uncheck reformat on file save .
To avoid IntelliJ IDEA replacing imports with * , you need to configure the Class count to use import with '*' and Names count to use static import with '*' preferences: Go to Preferences > Editor > Code Style > Java.
Rearrange code just does the 1st point, arranges it according to android code style guidelines. Reformat code does both 1st and 2nd point. Show activity on this post. Rearranging code does more things than just reformat the code.
Go to View | Tool Windows | Version Control - Local Changes tab- Right click the text "Default" - Commit Changes (or Arrow icon on the left hand sided toolbar inside Local Changes tab). Find Before Commit section.
and un-tick Rearrange code.
Refer this for more.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With