classes are not subject to the 'passing object to itself' sorting heuristic

This commit is contained in:
peter
2011-02-04 15:41:47 +01:00
parent 1e8caec1c2
commit d4d47954d4
4 changed files with 21 additions and 9 deletions
@@ -0,0 +1,7 @@
import foo.Foo;
class Bar {
{
Foo.foo(Foo<caret>x)
}
}
@@ -160,4 +160,14 @@ public class NormalCompletionOrderingTest extends CompletionSortingTestCase {
assertEquals("Foooo.Bar", presentation.getItemText());*/
}
public void testClassInCallOfItsMethod() throws Throwable {
final VirtualFile foo = getSourceRoot().createChildDirectory(this, "foo");
VfsUtil.saveText(foo.createChildData(this, "Foo.java"), "package foo; public interface Foo {}");
final VirtualFile bar = getSourceRoot().createChildDirectory(this, "bar");
VfsUtil.saveText(bar.createChildData(this, "Foo.java"), "package bar; public interface Foo {}");
checkPreferredItems(0, "Foo", "Foo");
assertEquals("foo.Foo", ((JavaPsiClassReferenceElement)getLookup().getCurrentItem()).getQualifiedName());
}
}
@@ -194,7 +194,7 @@ public class SmartTypeCompletionOrderingTest extends CompletionSortingTestCase {
}
public void testFactoryMethodForDefaultType() throws Throwable {
checkPreferredItems(0, "create", "map", "this", "getClass");
checkPreferredItems(0, "create", "this", "map", "getClass");
}
public void testLocalVarsBeforeClassLiterals() throws Throwable {