Skip to content

Conversation

@jtkiesel
Copy link
Contributor

@jtkiesel jtkiesel commented Sep 8, 2025

What changed with this PR:

instanceof expressions not at the root of the binary expression are now properly indented, like those at the root.

Example

Input

class Example {

  void example() {
    var a =
      a &&
      Foo.get(longlinelonglinelonglinelonglinelongline) instanceof
      NumberNumberNumberNumber n &&
      n.foo();

    var a =
      Foo.get(longlinelonglinelonglinelonglinelongline) instanceof
      NumberNumberNumberNumber n &&
      n.foo();
  }
}

Output

class Example {

  void example() {
    var a =
      a &&
      Foo.get(longlinelonglinelonglinelonglinelongline) instanceof
        NumberNumberNumberNumber n &&
      n.foo();

    var a =
      Foo.get(longlinelonglinelonglinelonglinelongline) instanceof
        NumberNumberNumberNumber n &&
      n.foo();
  }
}

Relative issues or prs:

Closes #762

@jtkiesel jtkiesel merged commit 6d3621b into jhipster:main Sep 9, 2025
6 checks passed
@jtkiesel jtkiesel deleted the fix/instanceof-indentation branch September 9, 2025 04:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorrect indentation after instanceof

1 participant