Post processing fuzzily matched autocomplete options

I’m happy with the fuzzy matching that @codemirror/autocomplete implements internally. After the fuzzy matching has sorted and filtered out options, I’d like to append a load more option at the very end to on-demand load more options. I figured out that in Completion.apply I can trigger the list of options to be updated once they have been fetched with startCompletion. My issue now is that I’d like to avoid re-implementing the fuzzy matching logic the library already has but the library also not exposing it nor providing a hook to customize the options post fuzzy matching.

Happy Easter!

Edit: I realized I have another sort criteria: I’d like to put exact apply text matches first.

I don’t think this is something that is possible with @codemirror/autocomplete. How are you updating the list of options? That already doesn’t sound like a thing the package supports.

Triggering startCompletion while the options are already open apparently causes the completion source to be run again, so I’d use that. The state is outside the editor and just accessed in the completion source, which is fine for my use case.

Wouldn’t that also apply the filtering then?