mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
introduce: suggest boxed type if applicable (IDEA-24049)
This commit is contained in:
@@ -244,20 +244,29 @@ public class TypeSelectorManagerImpl implements TypeSelectorManager {
|
||||
visitor.visitType(psiType);
|
||||
}
|
||||
|
||||
final PsiType defaultType = getDefaultType();
|
||||
for (int index = 0; index < result.size(); index++) {
|
||||
PsiType psiType = result.get(index);
|
||||
if (psiType.equals(getDefaultType())) {
|
||||
if (psiType.equals(defaultType)) {
|
||||
result.remove(index);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
final PsiPrimitiveType unboxedType = PsiPrimitiveType.getUnboxedType(getDefaultType());
|
||||
final PsiPrimitiveType unboxedType = PsiPrimitiveType.getUnboxedType(defaultType);
|
||||
if (unboxedType != null) {
|
||||
result.remove(unboxedType);
|
||||
result.add(0, unboxedType);
|
||||
}
|
||||
result.add(0, getDefaultType());
|
||||
|
||||
if (defaultType instanceof PsiPrimitiveType && myMainOccurence != null) {
|
||||
final PsiClassType boxedType = ((PsiPrimitiveType)defaultType).getBoxedType(myMainOccurence);
|
||||
if (boxedType != null) {
|
||||
result.remove(boxedType);
|
||||
result.add(0, boxedType);
|
||||
}
|
||||
}
|
||||
result.add(0, defaultType);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user