suggest inheritor members on second completion only, prefer the default collection getters to them

This commit is contained in:
peter
2011-10-19 15:20:38 +02:00
parent 751cc5aff9
commit ad2301818c
14 changed files with 54 additions and 15 deletions
@@ -223,9 +223,10 @@ public class JavaSmartCompletionContributor extends CompletionContributor {
parent != null &&
!(parent.getParent() instanceof PsiSwitchLabelStatement)) {
for (ExpectedTypeInfo info : mergedInfos) {
new JavaMembersGetter(info.getType()).addMembers(position, true, noTypeCheck);
final boolean searchInheritors = params.getInvocationCount() > 1;
new JavaMembersGetter(info.getType()).addMembers(position, searchInheritors, noTypeCheck);
if (!info.getDefaultType().equals(info.getType())) {
new JavaMembersGetter(info.getDefaultType()).addMembers(position, true, noTypeCheck);
new JavaMembersGetter(info.getDefaultType()).addMembers(position, searchInheritors, noTypeCheck);
}
}
}