mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
java completion: disprefer primitive types inside generics (IDEA-166668)
This commit is contained in:
@@ -263,7 +263,8 @@ public class PreferByKindWeigher extends LookupElementWeigher {
|
||||
}
|
||||
if (JavaKeywordCompletion.PRIMITIVE_TYPES.contains(keyword) || PsiKeyword.VOID.equals(keyword)) {
|
||||
boolean inCallArg = psiElement().withParents(PsiReferenceExpression.class, PsiExpressionList.class).accepts(myPosition);
|
||||
return inCallArg ? ThreeState.NO : ThreeState.UNSURE;
|
||||
boolean inTypeArg = psiElement().inside(PsiReferenceParameterList.class).accepts(myPosition);
|
||||
return inCallArg || inTypeArg ? ThreeState.NO : ThreeState.UNSURE;
|
||||
}
|
||||
return ThreeState.UNSURE;
|
||||
}
|
||||
|
||||
+1
-1
@@ -706,7 +706,7 @@ class ContainerUtil extends ContainerUtilRt {
|
||||
}
|
||||
|
||||
void testPreferExpectedMethodTypeArg() {
|
||||
checkPreferredItems 0, 'String'
|
||||
checkPreferredItems 0, 'String', 'Usage'
|
||||
}
|
||||
|
||||
void testMethodStatisticsPerQualifierType() {
|
||||
|
||||
Reference in New Issue
Block a user