mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-242810 Add colon to completion after "case" keyword
GitOrigin-RevId: 3b908b2eed06b41e08ef1c739d90a299389db8c9
This commit is contained in:
committed by
intellij-monorepo-bot
parent
f4618a1246
commit
824259dfc0
+3
-7
@@ -481,13 +481,9 @@ public class JavaCompletionContributor extends CompletionContributor {
|
||||
MultiMap<CompletionResultSet, LookupElement> items = MultiMap.create();
|
||||
final PsiElement position = parameters.getPosition();
|
||||
final boolean first = parameters.getInvocationCount() <= 1;
|
||||
final TailType switchLabelTail;
|
||||
if (IN_ENUM_SWITCH_LABEL.accepts(position)) {
|
||||
PsiSwitchBlock block = Objects.requireNonNull(PsiTreeUtil.getParentOfType(position, PsiSwitchBlock.class));
|
||||
switchLabelTail = TailTypes.forSwitchLabel(block);
|
||||
} else {
|
||||
switchLabelTail = null;
|
||||
}
|
||||
final TailType switchLabelTail = IN_SWITCH_LABEL.accepts(position)
|
||||
? TailTypes.forSwitchLabel(Objects.requireNonNull(PsiTreeUtil.getParentOfType(position, PsiSwitchBlock.class)))
|
||||
: null;
|
||||
final boolean isAfterNew = JavaClassNameCompletionContributor.AFTER_NEW.accepts(position);
|
||||
final boolean pkgContext = JavaCompletionUtil.inSomePackage(position);
|
||||
final PsiType[] expectedTypes = ExpectedTypesGetter.getExpectedTypes(parameters.getPosition(), true);
|
||||
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
class Main {
|
||||
public static final String STRING_CONSTANT = "abc";
|
||||
public static void main(String[] args) {
|
||||
switch (args[0]) {
|
||||
case STRC<caret>
|
||||
}
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
class Main {
|
||||
public static final String STRING_CONSTANT = "abc";
|
||||
public static void main(String[] args) {
|
||||
switch (args[0]) {
|
||||
case STRING_CONSTANT:<caret>
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
public class Demo {
|
||||
void foo(Integer i){
|
||||
switch(i) {
|
||||
case Types.CHAR<caret>
|
||||
case Types.CHAR:<caret>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
@@ -1998,4 +1998,6 @@ class Abc {
|
||||
myFixture.type('\n')
|
||||
checkResult()
|
||||
}
|
||||
|
||||
void testCaseColonAfterStringConstant() { doTest() }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user