mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-62188 Java: Basic completion doesn't suggest "default" keyword in switch construction
This commit is contained in:
@@ -503,8 +503,9 @@ public class JavaCompletionData extends JavaAwareCompletionData{
|
||||
new ParentElementFilter(new ClassFilter(PsiSwitchLabelStatement.class)),
|
||||
new LeftNeighbour(new OrFilter(
|
||||
new ParentElementFilter(new ClassFilter(PsiSwitchStatement.class), 2),
|
||||
new AndFilter(new TextFilter(";", "}", ":"),new ParentElementFilter(new ClassFilter(PsiSwitchStatement.class), 3)
|
||||
))))));
|
||||
new AndFilter(new TextFilter(";", ":"),new ParentElementFilter(new ClassFilter(PsiSwitchStatement.class), 3)),
|
||||
new AndFilter(new TextFilter("}"), new ParentElementFilter(new ClassFilter(PsiSwitchStatement.class), 4))
|
||||
)))));
|
||||
variant.includeScopeClass(PsiElement.class, false);
|
||||
variant.addCompletion(PsiKeyword.CASE, TailType.SPACE);
|
||||
variant.addCompletion(PsiKeyword.DEFAULT, TailType.CASE_COLON);
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
public class ConstConfig {
|
||||
{
|
||||
switch (a) {
|
||||
case Foooo: {}
|
||||
def<caret>
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
public class ConstConfig {
|
||||
{
|
||||
switch (a) {
|
||||
case Foooo: {}
|
||||
default:<caret>
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
@@ -583,6 +583,7 @@ public class NormalCompletionTest extends LightFixtureCompletionTestCase {
|
||||
}
|
||||
|
||||
public void testFieldNegation() throws Throwable { doTest('!');}
|
||||
public void testDefaultInSwitch() throws Throwable { doTest()}
|
||||
|
||||
public void testSuperInConstructor() throws Throwable {
|
||||
doTest();
|
||||
|
||||
Reference in New Issue
Block a user