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:
peter
2011-01-27 19:37:00 +01:00
parent 6c8b65e4cd
commit e782c50a1e
4 changed files with 26 additions and 0 deletions
@@ -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>)
}
}
@@ -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 {