dubreuia / intellij-plugin-save-actions

Supports configurable, Eclipse like, save actions, including "organize imports", "reformat code" and "rearrange code".
MIT License
529 stars 102 forks source link

Reformat Code not Working for 2022.2.2 #417

Open UltimateFighter opened 1 year ago

UltimateFighter commented 1 year ago

Describe the bug

Code Style Value: "Hard wrap at: 120"

If i have this code and i press STRG+S the code looks as follows and the code is formatted incorrectly (Line 9):

 6  public class Test {
 7      public void foo() {
 8          final boolean aLongVariableToDemonstrateInvalidFormatting = false;
 9          final boolean foobar = VeryLongMethodeToDemonstrateInvlaidFormatting(aLongVariableToDemonstrateInvalidFormatting);
10      }
11  
12      private boolean aVeryLongMethodeToDemonstrateInvlaidFormatting(final boolean value) {
13          return value;
14      }
15 }

After i press STRG+ALT+L (Reformat Code) the code is formatted correctly (Line 9 u. 10):

 6  public class Test {
 7      public void foo() {
 8          final boolean aLongVariableToDemonstrateInvalidFormatting = false;
 9          final boolean foobar =
10                  aVeryLongMethodToDemonstrateInvalidFormatting(aLongVariableToDemonstrateInvalidFormatting);
11      }
12  
13      private boolean aVeryLongMethodToDemonstrateInvalidFormatting(final boolean value) {
14          return value;
15      }
16  }

What triggered the plugin Auto Save (STRG+S)

Versions Intellij: IntelliJ IDEA 2022.2.2 (Build #IU-222.4167.29, built on September 13, 2022) Plugin: 2.3.0