User: joe Date: 09 Nov 25 22:46 Revision: 85c489798ecf6dcada2038e6852da8b123c03624 Summary: Suggest all targets when autocompleting with an ordinal. Closes #2214 TeamCity URL: http://ci.mcdev.io:80/viewModification.html?tab=vcsModificationFiles&modId=10255&personal=false Index: src/main/kotlin/platform/mixin/handlers/injectionPoint/InjectionPoint.kt =================================================================== --- src/main/kotlin/platform/mixin/handlers/injectionPoint/InjectionPoint.kt (revision 8fcf79305261b9420505631a1588dacb48c3e396) +++ src/main/kotlin/platform/mixin/handlers/injectionPoint/InjectionPoint.kt (revision 85c489798ecf6dcada2038e6852da8b123c03624) @@ -155,10 +155,16 @@ ) { addShiftSupport(at, targetClass, collectVisitor) addSliceFilter(at, targetClass, collectVisitor) - // make sure the ordinal filter is last, so that the ordinal only increments once the other filters have passed + + // Make sure the ordinal and specifier filters are last, so that the ordinal only increments once the other + // filters have passed, and the specifier acts on the result of them. + // Separately, these happen to also be the filters that we don't want to apply during completion, so that all + // results are shown. + if (mode != CollectVisitor.Mode.COMPLETION) { - addOrdinalFilter(at, targetClass, collectVisitor) + addOrdinalFilter(at, targetClass, collectVisitor) - addSpecifierFilter(at, targetClass, collectVisitor, defaultSpecifier, mode) + addSpecifierFilter(at, targetClass, collectVisitor, defaultSpecifier) - } + } + } protected open fun addShiftSupport(at: PsiAnnotation, targetClass: ClassNode, collectVisitor: CollectVisitor<*>) { collectVisitor.shiftBy = AtResolver.getShift(at) @@ -218,12 +224,7 @@ targetClass: ClassNode, collectVisitor: CollectVisitor, defaultSpecifier: InjectionPointSpecifier, - mode: CollectVisitor.Mode, ) { - if (mode == CollectVisitor.Mode.COMPLETION) { - // Ignore the specifier, we want to show all results - return - } val point = at.findDeclaredAttributeValue("value")?.constantStringValue ?: return val specifier = InjectionPointSpecifier.entries.firstOrNull { point.endsWith(":$it") } ?: defaultSpecifier collectVisitor.addResultFilter("specifier") { results, _ ->