John
John

Reputation: 1888

Annotations in parameters IDEA

Is there a way to set annotation in IntelliJ IDEA in a way that annotations are on their own line EXCEPT when annotating a parameter?

Example of what I mean and how I want it..

@Annotation
@Annotation
String variable; 

@Annotation
public void doMethod(@Annotation String x, @Annotation int y){

}

But everything in the settings seems to set it so i can only have one or the other.

Here are my settings enter image description here

With how I have my settings now my code comes out like this...

@Annotation
@Annotation
String variable;

@Annotation
public void doMethod(
        @Annotation
        final String x,
        @Annotation
        final int y) {

}

Upvotes: 1

Views: 213

Answers (1)

Makoto
Makoto

Reputation: 106389

My settings are as follows, which appears to give you the annotation style you're looking for:

  • Parameter annotations: Chop down if long
  • Local variable annotations: Do not wrap
  • Annotation parameters: Chop down if long
    • Align when multiline: Yes

Upvotes: 2

Related Questions