@basil-conto Thank you for the thorough review. I learned some things.
Everything should be as you suggested except for the
Do you have an Emacs CA?
If we don't add it, then users can't customise the ordering of candidates.
Not in Emacs 27:
But step (6) in Emacs 26.3 indeed results in the following error:
As expected, digging around shows that this function was added in Emacs 27: https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=cd1d9e79f74f137511d49eb9b0ae7ba750ba6c3c
You asked this in #2037 (comment) and the answer was yes.
avy-read et al. can return values that do not correspond to particular candidates, such as the symbol 'exit'. This is handled in avy-process, which sadly doesn't seem reusable in this case. Ideally, swiper-avy could reuse a higher-level avy API. Fixes #2062
Have `completion--done' obey the :exit-function logic for us. See `completion--do-completion'. Use case: the :exit-function in `eglot-completion-at-point' will erase the inserted annotation, which holds e.g. the function argument list, leaving only the function name.