diff --git a/idea/idea-completion/src/org/jetbrains/kotlin/idea/completion/LookupElementsCollector.kt b/idea/idea-completion/src/org/jetbrains/kotlin/idea/completion/LookupElementsCollector.kt index 8c4a99c23d9..7437957ce81 100644 --- a/idea/idea-completion/src/org/jetbrains/kotlin/idea/completion/LookupElementsCollector.kt +++ b/idea/idea-completion/src/org/jetbrains/kotlin/idea/completion/LookupElementsCollector.kt @@ -54,11 +54,6 @@ class LookupElementsCollector( resultSet.addAllElements(elements) elements.clear() isResultEmpty = false - - for (element in elements) { - val matchingDegree = RealPrefixMatchingWeigher.getBestMatchingDegree(element, prefixMatcher) - bestMatchingDegree = Math.max(bestMatchingDegree, matchingDegree) - } } } @@ -138,6 +133,9 @@ class LookupElementsCollector( } elements.add(result) + + val matchingDegree = RealPrefixMatchingWeigher.getBestMatchingDegree(result, prefixMatcher) + bestMatchingDegree = Math.max(bestMatchingDegree, matchingDegree) } // used to avoid insertion of spaces before/after ',', '=' on just typing