mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
IDEA-89056 Strange 'xxx[]' item is shown in smart completion list
This commit is contained in:
@@ -924,7 +924,7 @@ public class ExpectedTypesProvider {
|
||||
}
|
||||
}
|
||||
|
||||
final PsiExpression[] args = argumentList.getExpressions();
|
||||
final PsiExpression[] args = argumentList.getExpressions().clone();
|
||||
final int index = ArrayUtil.indexOf(args, argument);
|
||||
LOG.assertTrue(index >= 0);
|
||||
|
||||
@@ -932,6 +932,9 @@ public class ExpectedTypesProvider {
|
||||
if (index <= args.length - 1) {
|
||||
leftArgs = new PsiExpression[index];
|
||||
System.arraycopy(args, 0, leftArgs, 0, index);
|
||||
if (forCompletion) {
|
||||
args[index] = null;
|
||||
}
|
||||
}
|
||||
else {
|
||||
leftArgs = null;
|
||||
@@ -945,7 +948,7 @@ public class ExpectedTypesProvider {
|
||||
PsiSubstitutor substitutor;
|
||||
if (candidateInfo instanceof MethodCandidateInfo) {
|
||||
final MethodCandidateInfo info = (MethodCandidateInfo)candidateInfo;
|
||||
substitutor = info.inferTypeArguments(policy);
|
||||
substitutor = info.inferTypeArguments(policy, args);
|
||||
if (!info.isStaticsScopeCorrect() && method != null && !method.hasModifierProperty(PsiModifier.STATIC)) continue;
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -158,10 +158,6 @@ public class PsiTypeLookupItem extends LookupItem {
|
||||
|
||||
PsiTypeLookupItem item = doCreateItem(type, context, dim);
|
||||
|
||||
if (dim > 0) {
|
||||
item.setAttribute(TAIL_TEXT_ATTR, " " + StringUtil.repeat("[]", dim));
|
||||
item.setAttribute(TAIL_TEXT_SMALL_ATTR, "");
|
||||
}
|
||||
item.setAttribute(TYPE, original);
|
||||
return item;
|
||||
}
|
||||
@@ -228,10 +224,9 @@ public class PsiTypeLookupItem extends LookupItem {
|
||||
presentation.setItemText(((PsiType)object).getCanonicalText());
|
||||
presentation.setItemTextBold(getAttribute(LookupItem.HIGHLIGHTED_ATTR) != null || object instanceof PsiPrimitiveType);
|
||||
|
||||
String tailText = (String)getAttribute(LookupItem.TAIL_TEXT_ATTR);
|
||||
if (tailText != null) {
|
||||
presentation.setTailText(tailText, getAttribute(LookupItem.TAIL_TEXT_SMALL_ATTR) != null);
|
||||
}
|
||||
}
|
||||
if (myBracketsCount > 0) {
|
||||
presentation.setTailText(StringUtil.repeat("[]", myBracketsCount) + presentation.getTailText(), true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user