joaotavora / sly

Sylvester the Cat's Common Lisp IDE
1.24k stars 140 forks source link

Respect `completion-regexp-list` in `capf` collection functions #476

Open Janfel opened 2 years ago

Janfel commented 2 years ago

When passing a function as the collection argument to all-completions/try-completion/test-completion, these functions do not automatically filter the “collection” by completion-regexp-list, as they do for all non-function collections. Instead they leave this task to the passed-in function.

The collection functions provided by sly currently do not respect completion-regexp-list, causing the output of all-completions/try-completion/test-completion to not respect completion-regexp-list as well.

This breaks packages such as orderless, which depend on the output of all-completions being filtered by completion-regexp-list. See https://github.com/oantolin/orderless/issues/78 for a similar issue.

Rewriting sly--completion-function-wrapper to use complete-with-action seems to be an easy way to fix this.

joaotavora commented 2 years ago

I can probably add something to that effect, but it's unlikely that you'll be able to use "orderless" with SLY as you envision it. SLY uses a "backend" completion style and the normal made-for-Elisp styles don't work well with it. This has been discussed many times in many issues that I am unfortunately too lazy to unearth right now, but it shouldn't be hard, you can follow your own link to land in very similar bug reports and discussions in Eglot.