mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-20 13:31:28 +07:00
IDEA-154891 IDEA adds unnecessary space/colon on switch case autocompletion
This commit is contained in:
@@ -203,7 +203,7 @@ public class VariableLookupItem extends LookupItem<PsiVariable> implements Typed
|
||||
TailType.COMMA.processTail(context.getEditor(), context.getTailOffset());
|
||||
AutoPopupController.getInstance(context.getProject()).autoPopupParameterInfo(context.getEditor(), null);
|
||||
}
|
||||
else if (completionChar == ':') {
|
||||
else if (completionChar == ':' && getAttribute(LookupItem.TAIL_TYPE_ATTR) != TailType.UNKNOWN) {
|
||||
context.setAddCompletionChar(false);
|
||||
TailType.COND_EXPR_COLON.processTail(context.getEditor(), context.getTailOffset());
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
class Foo {
|
||||
void foo(Constants c) {
|
||||
switch (c) {
|
||||
case B<caret>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
enum Constants {
|
||||
BAR0, BAR1;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
class Foo {
|
||||
void foo(Constants c) {
|
||||
switch (c) {
|
||||
case BAR0:<caret>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
enum Constants {
|
||||
BAR0, BAR1;
|
||||
}
|
||||
@@ -1045,6 +1045,7 @@ public class ListUtils {
|
||||
public void testNoFieldsInImplements() throws Throwable { doTest() }
|
||||
|
||||
public void testSwitchConstantsFromReferencedClass() throws Throwable { doTest('\n') }
|
||||
public void testSwitchValueFinishWithColon() throws Throwable { doTest(':') }
|
||||
|
||||
public void testUnfinishedMethodTypeParameter() throws Throwable {
|
||||
configure()
|
||||
|
||||
Reference in New Issue
Block a user