indenter: distinguish control structure from call (WEB-52005)

GitOrigin-RevId: 9c65a140259e16b6e98f4a1f50a634b4b1686a97
This commit is contained in:
Konstantin Ulitin
2021-08-02 21:16:58 +00:00
committed by intellij-monorepo-bot
parent 1f5baef559
commit 6be1da1730
@@ -405,13 +405,15 @@ public abstract class JavaLikeLangLineIndentProvider implements LineIndentProvid
SemanticEditorPosition candidate = curr.copy();
curr.moveBefore();
curr.moveBeforeOptionalMix(Whitespace, LineComment, BlockComment);
if (!curr.isAt(RightParenthesis)) {
return candidate.getStartOffset();
}
else {
if (curr.isAt(RightParenthesis)) {
curr.moveBeforeParentheses(LeftParenthesis, RightParenthesis);
continue;
SemanticEditorPosition controlStructureCheck = curr.copy();
controlStructureCheck.moveBeforeOptionalMix(Whitespace, LineComment, BlockComment);
if (isStartOfStatementWithOptionalBlock(controlStructureCheck)) {
continue;
}
}
return candidate.getStartOffset();
}
else if (curr.isAt(BlockClosingBrace)) {
curr.moveBeforeParentheses(BlockOpeningBrace, BlockClosingBrace);