Async completion.info

Hi!

My integration with CodeMirror is server-based, so both autocomplete and retrieval of selected item info are asynchronous. For autocomplete itself it’s not a problem, but Completion.info is currently synchronous.

I started looking into implementing async version myself, but wanted to confirm few questions before doing any more work on the PR:

  • Do you have any concerns about changing info from string | fn(completion: Completion) → Node to string | fn(completion: Completion) → (Node | Promise<Node>)?

  • What level of test coverage that change would need? At a glance autocomplete/test-complete.ts at main · codemirror/autocomplete · GitHub does not seem to cover info, so if I need to unit-test that I’ll have to figure out a few things.

Btw – thanks for your work on CM, CM6 looks great and I learned a lot integrating it.

Makes sense to support this. I found it was straightforward to implement (as long as we don’t support cancellation tokens), and did so in this patch.

Thanks! Yep, that’s way more straightforward than what I planned, and covers all that I needed.