Intellij only wrap chained methods [if no shorter than 3] when formatting code in Java

485 views Asked by At

I like to wrap long chained methods in my code when i format it. But i don't like method chains that are small (ex: 3 methods or less) to be wrapped. So i want this to be wrapped:

OkHttpClient client = new OkHttpClient().newBuilder().connectTimeout(15, TimeUnit.SECONDS).writeTimeout(15, TimeUnit.SECONDS).readTimeout(30, TimeUnit.SECONDS).build();

but NOT this

String[] str = object.toString().split(":");

Is there anyway in Intellij to can control how long the chain has to be in order for it to be wrapped?

1

There are 1 answers

0
Rafat Mahmoud On BEST ANSWER

This is NOT possible on the latest version of Intellij Idea, however you may want to submit a feature request here.