Reformat code - line break in string

Answered

I have some problems configuring my intellij to how I want it to reformat code:

I have the code (generated from swagger doc)

@ApiModelProperty(example = "0", value = "Flag for prompting the user to confirm their phone number")

Currently, intellij reformats this to:

@ApiModelProperty(example = "0", value = "Flag for prompting the user to confirm their phone "
+ "number")

but I would like it to format it to:

@ApiModelProperty(example = "0", 
value = "Flag for prompting the user to confirm their phone number")

So that it breaks on the parameters instead of the string. Is this possible? 

1
4 comments

Hi. Related settings are in Editor | Code Style | Java | Wrapping and Braces | * Annotation

0
Avatar
Permanently deleted user

Thank you for your answer. I can't seem to find a setting that controls this? When playing around with the settings, it always breaks in the string instead of moving the property to another line. Do you know which property it is, and what it should be set to?

0

Editor | Code Style | Java | Wrapping and Braces | Annotation with parameters - Wrap always + align when multiline, works fine:

@ApiModelProperty(example = "0",
value = "Flag for prompting the user to confirm their phone number")
0
Avatar
Permanently deleted user

Awesome, that works. Thanks :)

Seems obvious now you pointed it out. 

0

Please sign in to leave a comment.