Reputation: 1179
I am using the Google-java-formatter in IntelliJ IDEA. I tried all the option present under setting > editor > code Style > java but not able to change this behavior.
private void insertOfflinePreferences(String loginId, String clientId, List<AlertPrefsNgBO> alertPrefsNgBOS) {
List<SubscriptionAlertEntity> subscriptionAlertEntities = subscriptionAlertRepository.getSubscriptionAlertEntities(login);
This line is getting formatted as
private void insertOfflinePreferences(
String loginId, String clientId, List<AlertPrefsNgBO> alertPrefsNgBOS) {
List<SubscriptionAlertEntity> subscriptionAlertEntities =
subscriptionAlertRepository.getSubscriptionAlertEntities(login);
I don't want the line change. It is doing same for the stream operations in java.
Upvotes: 0
Views: 5027
Reputation: 140318
Note: There is no configurability as to the formatter's algorithm for formatting. This is a deliberate design decision to unify our code formatting on a single format.
Either use google-java-formatter, or don't. (I simply stopped caring about GJF's choices years ago, because I'm used to it; and even in cases where it doesn't format it exactly how I'd like, the formatting is not totally disagreeable).
Upvotes: 4
Reputation: 1909
If I understand well, you want the IntelliJ to stop wrapping your lines ?
For that you can set the Hard Wrap field to a higher value. The default is 120, which means that every line of more than 120 characters will be wrapped.
You can find this parameter in Settings>Editor>Code Style (And not in Settings>Editor>Code Style>Java)
Upvotes: 1