mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Fix lost indent in block statement
IDEA-179073 JavaLikeIndentProvider indent miss
This commit is contained in:
@@ -234,4 +234,18 @@ public class JavaEnterActionTest extends AbstractEnterActionTestCase {
|
||||
"\t\t\t<caret>\n" +
|
||||
") {}");
|
||||
}
|
||||
|
||||
public void testIdea179073() throws IOException {
|
||||
doTextTest("java",
|
||||
"ArrayList<String> strings = new ArrayList<>();\n" +
|
||||
" strings.stream()\n" +
|
||||
" .forEach((e) -> {<caret>\n" +
|
||||
" });",
|
||||
|
||||
"ArrayList<String> strings = new ArrayList<>();\n" +
|
||||
" strings.stream()\n" +
|
||||
" .forEach((e) -> {\n" +
|
||||
" <caret>\n" +
|
||||
" });");
|
||||
}
|
||||
}
|
||||
+3
@@ -212,12 +212,15 @@ public abstract class JavaLikeLangLineIndentProvider implements LineIndentProvid
|
||||
}
|
||||
else if (position.isAt(RightParenthesis)) {
|
||||
position.beforeParentheses(LeftParenthesis, RightParenthesis);
|
||||
continue;
|
||||
}
|
||||
else if (position.isAt(BlockClosingBrace)) {
|
||||
position.beforeParentheses(BlockOpeningBrace, BlockClosingBrace);
|
||||
continue;
|
||||
}
|
||||
else if (position.isAt(ArrayClosingBracket)) {
|
||||
position.beforeParentheses(ArrayOpeningBracket, ArrayClosingBracket);
|
||||
continue;
|
||||
}
|
||||
else if (position.isAtAnyOf(Semicolon,
|
||||
BlockOpeningBrace,
|
||||
|
||||
Reference in New Issue
Block a user