Lines 111-116
Link Here
|
111 |
boolean assistNodeIsAnnotation; |
111 |
boolean assistNodeIsAnnotation; |
112 |
boolean assistNodeIsConstructor; |
112 |
boolean assistNodeIsConstructor; |
113 |
int assistNodeInJavadoc = 0; |
113 |
int assistNodeInJavadoc = 0; |
|
|
114 |
boolean assistNodeCanBeSingleMemberAnnotation = false; |
114 |
|
115 |
|
115 |
IJavaProject javaProject; |
116 |
IJavaProject javaProject; |
116 |
CompletionParser parser; |
117 |
CompletionParser parser; |
Lines 1203-1233
Link Here
|
1203 |
findAnnotationReference(annotation.type, scope); |
1204 |
findAnnotationReference(annotation.type, scope); |
1204 |
} |
1205 |
} |
1205 |
} else { |
1206 |
} else { |
1206 |
MemberValuePair[] memberValuePairs = annotation.memberValuePairs(); |
|
|
1207 |
if (!this.requestor.isIgnored(CompletionProposal.ANNOTATION_ATTRIBUTE_REF)) { |
1207 |
if (!this.requestor.isIgnored(CompletionProposal.ANNOTATION_ATTRIBUTE_REF)) { |
1208 |
this.findAnnotationAttributes(this.completionToken, annotation.memberValuePairs(), (ReferenceBinding)annotation.resolvedType); |
1208 |
this.findAnnotationAttributes(this.completionToken, annotation.memberValuePairs(), (ReferenceBinding)annotation.resolvedType); |
1209 |
} |
1209 |
} |
1210 |
if (memberValuePairs == null || memberValuePairs.length == 0) { |
1210 |
if (this.assistNodeCanBeSingleMemberAnnotation) { |
1211 |
if (annotation.resolvedType instanceof ReferenceBinding) { |
1211 |
if (this.expectedTypesPtr > -1 && this.expectedTypes[0].isAnnotationType()) { |
1212 |
MethodBinding[] methodBindings = |
1212 |
findTypesAndPackages(this.completionToken, scope); |
1213 |
((ReferenceBinding)annotation.resolvedType).availableMethods(); |
1213 |
} else { |
1214 |
if (methodBindings != null && |
1214 |
findVariablesAndMethods( |
1215 |
methodBindings.length == 1 && |
1215 |
this.completionToken, |
1216 |
CharOperation.equals(methodBindings[0].selector, VALUE)) { |
1216 |
scope, |
1217 |
if (this.expectedTypesPtr > -1 && this.expectedTypes[0].isAnnotationType()) { |
1217 |
FakeInvocationSite, |
1218 |
findTypesAndPackages(this.completionToken, scope); |
1218 |
scope, |
1219 |
} else { |
1219 |
insideTypeAnnotation, |
1220 |
findVariablesAndMethods( |
1220 |
true); |
1221 |
this.completionToken, |
1221 |
// can be the start of a qualified type name |
1222 |
scope, |
1222 |
findTypesAndPackages(this.completionToken, scope); |
1223 |
FakeInvocationSite, |
|
|
1224 |
scope, |
1225 |
insideTypeAnnotation, |
1226 |
true); |
1227 |
// can be the start of a qualified type name |
1228 |
findTypesAndPackages(this.completionToken, scope); |
1229 |
} |
1230 |
} |
1231 |
} |
1223 |
} |
1232 |
} |
1224 |
} |
1233 |
} |
1225 |
} |
Lines 6100-6109
Link Here
|
6100 |
if(annotation.resolvedType instanceof ReferenceBinding) { |
6092 |
if(annotation.resolvedType instanceof ReferenceBinding) { |
6101 |
MethodBinding[] methodBindings = |
6093 |
MethodBinding[] methodBindings = |
6102 |
((ReferenceBinding)annotation.resolvedType).availableMethods(); |
6094 |
((ReferenceBinding)annotation.resolvedType).availableMethods(); |
6103 |
if(methodBindings != null && |
6095 |
if (methodBindings != null && |
6104 |
methodBindings.length == 1 && |
6096 |
methodBindings.length > 0 && |
6105 |
CharOperation.equals(methodBindings[0].selector, VALUE)) { |
6097 |
CharOperation.equals(methodBindings[0].selector, VALUE)) { |
6106 |
addExpectedType(methodBindings[0].returnType, scope); |
6098 |
boolean canBeSingleMemberAnnotation = true; |
|
|
6099 |
done : for (int i = 1; i < methodBindings.length; i++) { |
6100 |
if(methodBindings[i].getDefaultValue() == null) { |
6101 |
canBeSingleMemberAnnotation = false; |
6102 |
break done; |
6103 |
} |
6104 |
} |
6105 |
if (canBeSingleMemberAnnotation) { |
6106 |
this.assistNodeCanBeSingleMemberAnnotation = canBeSingleMemberAnnotation; |
6107 |
addExpectedType(methodBindings[0].returnType, scope); |
6108 |
} |
6107 |
} |
6109 |
} |
6108 |
} |
6110 |
} |
6109 |
} |
6111 |
} |