mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-19 13:02:30 +07:00
support space between class and caret in IDEA-118194 complete statement works strange for inner classes / enums
This commit is contained in:
@@ -16,7 +16,9 @@ public class MissingClassBodyFixer implements Fixer {
|
||||
PsiClass psiClass = (PsiClass) psiElement;
|
||||
|
||||
if (psiClass.getLBrace() == null) {
|
||||
editor.getDocument().insertString(psiClass.getTextRange().getEndOffset(), " {\n}");
|
||||
int offset = psiClass.getTextRange().getEndOffset();
|
||||
editor.getDocument().insertString(offset, " {\n}");
|
||||
editor.getCaretModel().moveToOffset(offset);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
public class Foo {
|
||||
public static enum MyEnum <caret>
|
||||
|
||||
public void foo() {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
public class Foo {
|
||||
public static enum MyEnum {
|
||||
<caret>
|
||||
}
|
||||
|
||||
public void foo() {
|
||||
}
|
||||
}
|
||||
@@ -109,6 +109,8 @@ public class CompleteStatementTest extends EditorActionTestCase {
|
||||
public void testClass() throws Exception { doTest(); }
|
||||
|
||||
public void testInnerEnumBeforeMethod() { doTest(); }
|
||||
|
||||
public void testInnerEnumBeforeMethodWithSpace() { doTest(); }
|
||||
|
||||
public void testCompleteElseIf() throws Exception { doTest(); }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user