Skip to content

Commit 55ee6b2

Browse files
committed
Fix: Fix @Shadow suggestions being incorrectly prioritized.
Adding our elements one by one lets some of them get frozen above the normal suggestions. Instead, we should add them all in a batch.
1 parent 94886bc commit 55ee6b2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/main/kotlin/platform/mixin/completion/MixinCompletionContributor.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,12 +106,14 @@ class MixinCompletionContributor : CompletionContributor() {
106106
}
107107

108108
// Process methods and fields from target class
109-
findShadowTargets(psiClass, start, superMixin != null)
109+
val elements = findShadowTargets(psiClass, start, superMixin != null)
110110
.map { it.createLookupElement(psiClass.project) }
111111
.filter { prefixMatcher.prefixMatches(it) }
112112
.filter(filter, position)
113113
.map { PrioritizedLookupElement.withExplicitProximity(it, 1) }
114-
.forEach(r::addElement)
114+
.toList()
115+
116+
r.addAllElements(elements)
115117
}
116118
}
117119
}

0 commit comments

Comments
 (0)