mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[java-formatter] reformat added while added block
This commit is contained in:
@@ -1289,7 +1289,7 @@ public abstract class AbstractJavaBlock extends AbstractBlock implements JavaBlo
|
||||
|
||||
int startOffset = getTextRange().getStartOffset();
|
||||
if (ranges.isOnInsertedLine(startOffset)) {
|
||||
if (myNode instanceof PsiForStatement || myNode instanceof PsiIfStatement) {
|
||||
if (myNode instanceof PsiForStatement || myNode instanceof PsiIfStatement || myNode instanceof PsiWhileStatement) {
|
||||
return new ExtraReformatRanges(myNode.getTextRange());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,6 +83,32 @@ class X {
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
)
|
||||
}
|
||||
|
||||
fun `test while block`() {
|
||||
myLineRange = TextRange(3, 3)
|
||||
check(
|
||||
"""
|
||||
class X {
|
||||
void test() {
|
||||
while (true) {
|
||||
int a = 2;
|
||||
int b = 3;
|
||||
}
|
||||
}
|
||||
}
|
||||
""",
|
||||
"""
|
||||
class X {
|
||||
void test() {
|
||||
while (true) {
|
||||
int a = 2;
|
||||
int b = 3;
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user