mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
IDEA-79836 Java formatter: Correct processing of incomplete method call expression with anonymous class arguments
This commit is contained in:
@@ -1078,6 +1078,7 @@ public abstract class AbstractJavaBlock extends AbstractBlock implements JavaBlo
|
||||
boolean isAfterIncomplete = false;
|
||||
|
||||
ASTNode prev = child;
|
||||
boolean afterAnonymousClass = false;
|
||||
while (child != null) {
|
||||
isAfterIncomplete = isAfterIncomplete || child.getElementType() == TokenType.ERROR_ELEMENT ||
|
||||
child.getElementType() == JavaElementType.EMPTY_EXPRESSION;
|
||||
@@ -1087,7 +1088,7 @@ public abstract class AbstractJavaBlock extends AbstractBlock implements JavaBlo
|
||||
}
|
||||
else if (child.getElementType() == to) {
|
||||
result.add(createJavaBlock(child, mySettings,
|
||||
externalIndent,
|
||||
isAfterIncomplete && !afterAnonymousClass ? internalIndent : externalIndent,
|
||||
null,
|
||||
isAfterIncomplete ? alignmentStrategy.getAlignment(null) : bracketAlignment));
|
||||
return child;
|
||||
@@ -1103,6 +1104,9 @@ public abstract class AbstractJavaBlock extends AbstractBlock implements JavaBlo
|
||||
}
|
||||
}
|
||||
isAfterIncomplete = false;
|
||||
if (child.getElementType() != JavaTokenType.COMMA) {
|
||||
afterAnonymousClass = isAnonymousClass(child);
|
||||
}
|
||||
}
|
||||
prev = child;
|
||||
child = child.getTreeNext();
|
||||
|
||||
Reference in New Issue
Block a user