Skip to content

Commit

Permalink
fix: stable reformating for method invocation with only comments
Browse files Browse the repository at this point in the history
  • Loading branch information
clementdessoude committed Mar 14, 2021
1 parent 69a44cf commit aa99a4e
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 4 deletions.
4 changes: 0 additions & 4 deletions packages/prettier-plugin-java/src/printers/expressions.js
Original file line number Diff line number Diff line change
Expand Up @@ -586,10 +586,6 @@ class ExpressionsPrettierVisitor {
}

methodInvocationSuffix(ctx, params) {
if (ctx.argumentList === undefined) {
return rejectAndConcat([ctx.LBrace[0], ctx.RBrace[0]]);
}

const argumentList = this.visit(ctx.argumentList);
if (params && params.shouldDedent) {
return dedent(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,20 @@ void t() {
void t() {

}

public static final List<Object> XXXXXXXXXXXXXXXXXX = Collections.unmodifiableList(
Arrays.asList(// a
// b
// c
// d
)
);

public static final List<Object> XXXXXXXXXXXXXXXXXX = Collections.unmodifiableList(
Arrays.asList(// a
// b
// c
// d
/*e*/)
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,21 @@ void t() {}
*line 2
*/
void t() {}

public static final List<Object> XXXXXXXXXXXXXXXXXX = Collections.unmodifiableList(
Arrays.asList( // a
// b
// c
// d
)
);

public static final List<Object> XXXXXXXXXXXXXXXXXX = Collections.unmodifiableList(
Arrays.asList( // a
// b
// c
// d
/*e*/
)
);
}

0 comments on commit aa99a4e

Please sign in to comment.