mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Keep line break after end of line comment in modifier list (IDEA-129964)
This commit is contained in:
@@ -1129,7 +1129,12 @@ public class JavaSpacePropertyProcessor extends JavaElementVisitor {
|
||||
|
||||
@Override
|
||||
public void visitModifierList(PsiModifierList list) {
|
||||
myResult = Spacing.createSpacing(1, 1, 0, mySettings.KEEP_LINE_BREAKS, mySettings.KEEP_BLANK_LINES_IN_CODE);
|
||||
if (myType1 == JavaTokenType.END_OF_LINE_COMMENT) {
|
||||
myResult = Spacing.createSpacing(0, Integer.MAX_VALUE, 1, mySettings.KEEP_LINE_BREAKS, mySettings.KEEP_BLANK_LINES_IN_CODE);
|
||||
}
|
||||
else {
|
||||
myResult = Spacing.createSpacing(1, 1, 0, mySettings.KEEP_LINE_BREAKS, mySettings.KEEP_BLANK_LINES_IN_CODE);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -589,4 +589,20 @@ public class JavaFormatterSpaceTest extends AbstractJavaFormatterTest {
|
||||
"};"
|
||||
);
|
||||
}
|
||||
|
||||
public void testCommentBetweenAnnotationAndModifierList() {
|
||||
getSettings().KEEP_LINE_BREAKS = false;
|
||||
getSettings().KEEP_FIRST_COLUMN_COMMENT = false;
|
||||
doClassTest("@Override\n" +
|
||||
"//FIX me this stupid stuff\n" +
|
||||
"public void run() {\n" +
|
||||
" int a = 2;\n" +
|
||||
"}",
|
||||
|
||||
"@Override\n" +
|
||||
"//FIX me this stupid stuff\n" +
|
||||
"public void run() {\n" +
|
||||
" int a = 2;\n" +
|
||||
"}");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user