mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-64713 Using a comma in code completion inserts a trailing space for method calls but not for variable names
This commit is contained in:
@@ -37,5 +37,9 @@ public class VariableLookupItem extends LookupItem<PsiVariable> implements Typed
|
||||
context.setAddCompletionChar(false);
|
||||
TailType.EQ.processTail(context.getEditor(), context.getTailOffset());
|
||||
}
|
||||
else if (context.getCompletionChar() == ',' && getAttribute(LookupItem.TAIL_TYPE_ATTR) != TailType.UNKNOWN) {
|
||||
context.setAddCompletionChar(false);
|
||||
TailType.COMMA.processTail(context.getEditor(), context.getTailOffset());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
class AbcdClass {}
|
||||
class AbcdException extends Throwable {}
|
||||
|
||||
class Foo {
|
||||
{
|
||||
int aaa;
|
||||
int aab;
|
||||
equals(aa<caret>)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
class AbcdClass {}
|
||||
class AbcdException extends Throwable {}
|
||||
|
||||
class Foo {
|
||||
{
|
||||
int aaa;
|
||||
int aab;
|
||||
equals(aaa, <caret>)
|
||||
}
|
||||
}
|
||||
+2
@@ -823,6 +823,8 @@ public class NormalCompletionTest extends LightFixtureCompletionTestCase {
|
||||
public void testOnlyAnnotationsAfterAt() throws Throwable { doTest() }
|
||||
public void testOnlyExceptionsInCatch() throws Throwable { doTest() }
|
||||
|
||||
public void testCommaAfterVariable() throws Throwable { doTest(',') }
|
||||
|
||||
public void testSuperProtectedMethod() throws Throwable {
|
||||
myFixture.addClass """package foo;
|
||||
public class Bar {
|
||||
|
||||
Reference in New Issue
Block a user