[^ann] IDEA-85082 IDEA erroneously uses qualified class names for type parameters when using smart completion for inner class

This commit is contained in:
peter
2012-04-23 15:45:27 +02:00
parent ea21f25be5
commit 9c2e2c691e
4 changed files with 32 additions and 2 deletions
@@ -78,8 +78,9 @@ public class PsiTypeLookupItem extends LookupItem {
PsiElement position = context.getFile().findElementAt(context.getStartOffset());
assert position != null;
context.getDocument().insertString(context.getTailOffset(), calcGenerics(position, context));
JavaCompletionUtil.shortenReference(context.getFile(), context.getStartOffset());
int genericsStart = context.getTailOffset();
context.getDocument().insertString(genericsStart, calcGenerics(position, context));
JavaCompletionUtil.shortenReference(context.getFile(), genericsStart - 1);
int tail = context.getTailOffset();
String braces = StringUtil.repeat("[]", getBracketsCount());
@@ -0,0 +1,14 @@
public class Test {
{
new Foo<String>().method(new Outer.Inner<String>());<caret>
}
static class Outer {
static class Inner<A> {}
}
class Foo<A> {
public void method(Outer.Inner<A> inner) {}
}
}
@@ -0,0 +1,14 @@
public class Test {
{
new Foo<String>().method(new <caret>);
}
static class Outer {
static class Inner<A> {}
}
class Foo<A> {
public void method(Outer.Inner<A> inner) {}
}
}
@@ -1034,6 +1034,7 @@ public class SmartTypeCompletionTest extends LightFixtureCompletionTestCase {
public void testArrayInitializerBeforeVarargs() throws Throwable { doTest(); }
public void testDuplicateMembersFromSuperClass() throws Throwable { doTest(); }
public void testInnerAfterNew() throws Throwable { doTest(); }
public void testMemberImportStatically() {
configureByTestName();