IDEA-84963 Disprefer annotations in autocomplete at places where they cannot be used

This commit is contained in:
peter
2012-07-24 10:31:15 +02:00
parent 0364eb48a6
commit 42eebc6127
7 changed files with 287 additions and 197 deletions
@@ -0,0 +1,12 @@
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
@Z<caret>
@interface Foo {
}
@Target({ElementType.ANNOTATION_TYPE})
@interface ZMetaAnno {}
@Target({ElementType.LOCAL_VARIABLE})
@interface ZLocalAnno {}
@@ -342,6 +342,10 @@ public class NormalCompletionOrderingTest extends CompletionSortingTestCase {
checkPreferredItems 0, 'serial', 'superExpressionInIllegalContext'
}
public void testPreferApplicableAnnotations() throws Throwable {
checkPreferredItems 0, 'ZMetaAnno', 'ZLocalAnno'
}
public void testJComponentAddNewWithStats() throws Throwable {
final LookupImpl lookup = invokeCompletion("/../smartTypeSorting/JComponentAddNew.java");
assertPreferredItems(0, "FooBean3", "JComponent", "Component");