Hi.
On 10/08/2015 12:46, Mungo Carstairs (Staff) wrote:
>
> It looks like our current code formatting settings will split
> annotations thus:
>
>
> @Test(groups = { "Functional" })
>
>
> reformats to
>
>
> @Test(groups =
>
> { "Functional"})
>
... but they are both valid, I see.
> It seems Eclipse is not smart enough to realise this is not an array
> declaration.
>
> If I change this formatter preference (from 'Next line'):
>
>
>
>
> then the line is not split.
>
> The option is saved in .settings/org.eclipse.jdt.core.prefs as
>
>
> org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
>
>
> Shall we make this change to formatting?
>
How about 'Next line on wrap' - and tick the 'keep empty array
initializer' option. It's a nice compromise that fits with our current
formatting style.
There's also a specific setting for annotation parameter elements which
we probably ought to set.
1. Line Wrapping, select Annotations->element-value pairs
2. Set it to Wrap all elements, every element on a new line, and the
indent policy to 'indent by one'.
We're going to be using annotation parameters an awful lot more with
OSGi so it'd be good to finalise this now.
Jim
_______________________________________________
Jalview-dev mailing list
[email protected]
http://www.compbio.dundee.ac.uk/mailman/listinfo/jalview-dev