mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-129587 Code folding of one-line methods hides array brackets
This commit is contained in:
+5
@@ -625,6 +625,11 @@ public abstract class JavaFoldingBuilderBase extends CustomFoldingBuilder implem
|
||||
}
|
||||
|
||||
int leftStart = method.getParameterList().getTextRange().getEndOffset();
|
||||
|
||||
if (!StringUtil.isEmptyOrSpaces(document.getCharsSequence().subSequence(leftStart + 1, body.getTextRange().getStartOffset()))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
int leftEnd = statement.getTextRange().getStartOffset();
|
||||
int rightStart = statement.getTextRange().getEndOffset();
|
||||
int rightEnd = body.getTextRange().getEndOffset();
|
||||
|
||||
@@ -578,10 +578,14 @@ class Test {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int arrayMethod(int param)[] {
|
||||
return new int[];
|
||||
}
|
||||
|
||||
}"""
|
||||
PsiClass fooClass = JavaPsiFacade.getInstance(project).findClass('Foo', GlobalSearchScope.allScope(project))
|
||||
def regions = myFixture.editor.foldingModel.allFoldRegions.sort { it.startOffset }
|
||||
assert regions.size() == 3
|
||||
assert regions.size() == 4
|
||||
checkAccessorFolding(regions[0], regions[1], fooClass.methods[0])
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user