Align chained constructor calls

Answered

I can't find any formatting option to align chained constructor calls, eg

Thing thing = new Thing.Builder(param1, param2)
.withOtherThing(thingamajig)
.build();

or

Thing thing = new Thing()
.withOtherThing(thingamajig);

Is this possible to do currently? If not, can it be submitted as a feature request?

4 comments
Comment actions Permalink

Chained method calls wrapping settings apply to constructors as well:

0
Comment actions Permalink

I'm using the latest version of IntelliJ, but that option doesn't apply to constructors for me:

0
Comment actions Permalink

The setting applies only to method names, not class names. In this case `Builder` is a class and `Thing.Builder` is a qualified constructor name. If you need to extend this feature to the class name, please submit a feature request.

0

Please sign in to leave a comment.