Skip to content

Commit 9dd4b56

Browse files
committed
Fix relevance
* for enumConstants * for types
1 parent 106aa22 commit 9dd4b56

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

org.eclipse.jdt.core.javac/src/org/eclipse/jdt/internal/codeassist/DOMCompletionEngine.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4023,7 +4023,7 @@ private CompletionProposal toProposal(IBinding binding, String completion) {
40234023
binding instanceof IMethodBinding methodBinding ? methodBinding.getReturnType() :
40244024
binding instanceof IVariableBinding variableBinding ? variableBinding.getType() :
40254025
this.toComplete.getAST().resolveWellKnownType(Object.class.getName()), this.expectedTypes) +
4026-
(isInQualifiedName || res.getRequiredProposals() != null || inJavadoc ? 0 : RelevanceUtils.computeRelevanceForQualification(false, this.prefix, this.qualifiedPrefix)) +
4026+
(isInQualifiedName || res.getRequiredProposals() != null || inJavadoc ? 0 : RelevanceUtils.computeRelevanceForQualification(new String(res.getCompletion()).indexOf('.') >= 0, this.prefix, this.qualifiedPrefix)) +
40274027
RelevanceConstants.R_NON_RESTRICTED +
40284028
RelevanceUtils.computeRelevanceForInheritance(this.qualifyingType, binding) +
40294029
((insideQualifiedReference() && !staticOnly() && !Modifier.isStatic(binding.getModifiers())) || (inJavadoc && !res.isConstructor()) ? RelevanceConstants.R_NON_STATIC : 0) +
@@ -4180,7 +4180,7 @@ private CompletionProposal toProposal(IType type) {
41804180
+ RelevanceConstants.R_NON_RESTRICTED
41814181
+ (inCatchClause && DOMCompletionUtil.findInSupers(type, "Ljava/lang/Exception;", this.workingCopyOwner, this.typeHierarchyCache) ? RelevanceConstants.R_EXCEPTION : 0)
41824182
+ RelevanceUtils.computeRelevanceForInheritance(this.qualifyingType, type)
4183-
+ RelevanceUtils.computeRelevanceForQualification(!type.getFullyQualifiedName().startsWith("java.") && !nodeInImports && !fromCurrentCU && !inSamePackage && !typeIsImported, this.prefix, this.qualifiedPrefix)
4183+
+ RelevanceUtils.computeRelevanceForQualification(!"java.lang".equals(type.getPackageFragment().getElementName()) && !nodeInImports && !fromCurrentCU && !inSamePackage && !typeIsImported, this.prefix, this.qualifiedPrefix)
41844184
+ (type.getFullyQualifiedName().startsWith("java.") ? RelevanceConstants.R_JAVA_LIBRARY : 0)
41854185
// sometimes subclasses and superclasses are considered, sometimes they aren't
41864186
+ (inCatchClause ? RelevanceUtils.computeRelevanceForExpectingType(type, expectedTypes, this.workingCopyOwner, this.typeHierarchyCache) : RelevanceUtils.simpleComputeRelevanceForExpectingType(type, expectedTypes))

0 commit comments

Comments
 (0)