IDEA-118100 Annotation enum attribute auto-completion

This commit is contained in:
peter
2013-12-15 20:04:54 +01:00
parent 3874a1ea97
commit 924e475d89
3 changed files with 15 additions and 1 deletions
@@ -307,7 +307,8 @@ public class ExpectedTypesProvider {
if (type == null) return;
final ExpectedTypeInfoImpl info = createInfoImpl(type, ExpectedTypeInfo.TYPE_OR_SUBTYPE, type, TailType.UNKNOWN);
if (type instanceof PsiArrayType) {
myResult = new ExpectedTypeInfo[]{info, createInfoImpl(((PsiArrayType)type).getComponentType(), ExpectedTypeInfo.TYPE_OR_SUBTYPE, type, TailType.UNKNOWN)};
PsiType componentType = ((PsiArrayType)type).getComponentType();
myResult = new ExpectedTypeInfo[]{info, createInfoImpl(componentType, ExpectedTypeInfo.TYPE_OR_SUBTYPE, componentType, TailType.UNKNOWN)};
}
else {
myResult = new ExpectedTypeInfo[] {info};
@@ -0,0 +1,9 @@
public class Foo {
@MyAnno(value = <caret>)
}
@interface MyAnno {
MyEnum[] value();
}
enum MyEnum { FOO, BAR }
@@ -620,4 +620,8 @@ interface TxANotAnno {}
checkPreferredItems 0, 'String', 'System', 'Set'
}
public void testAnnotationEnum() {
checkPreferredItems 0, 'MyEnum.BAR', 'MyEnum', 'MyEnum.FOO'
}
}