Bug 549342 - Formatter for Arrays within Annotations
Summary: Formatter for Arrays within Annotations
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.13   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-07-17 06:36 EDT by nimo mayr CLA
Modified: 2019-07-18 07:11 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description nimo mayr CLA 2019-07-17 06:36:26 EDT
Please add a new "formatter option" (for Java/Javascript) within 

"Line Wrapping->Wrapping Settings->Annotations with Arrays"

For example, I have this:


@JsonbPropertyOrder(value = {"id", "username", "email", "hobbies"})

And I want to line break all items within a value-property to have this:

@JsonbPropertyOrder(value = { 
		"id", 
		"username", 
		"email", 
		"hobbies", 
		})
Comment 1 Mateusz Matela CLA 2019-07-18 06:43:25 EDT
This is controlled by the Wrapping settings -> Other expressions -> Array initializers.
Did you not notice this or do you think it should be a separate option?

Also, AFAIK Javascript is handled by a completely different component.
Comment 2 nimo mayr CLA 2019-07-18 07:11:14 EDT
I think it should be definitly a separate option, because:

Formatting annotations should be treated differently from the rest of the code. 

Only because I want to format the annotations, I do not want to format all other arrays in my code. 

Would be nice to create a seperate option (for example, "Wrapping settings -> Other expressions -> Array initializers in Annotations").