-
-
Notifications
You must be signed in to change notification settings - Fork 645
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[completion] Use ignore instead of try-completion-function in CIDER completion style #3750
Conversation
Thanks @alexander-yakushev! This fixes the error. One thing I noticed with the cider completion style, the matched characters are not highlighted in the candidates list. With built-in Another issue I noticed is that "fuzzy" matching doesn't really work, if I type |
Wait, did you really typed |
Yes, it works with |
I'm not sure if it works with company though, but it definitely works with built-in completion and with corfu. |
Are you sure you haven't triggered completion at Otherwise I don't understand how this is possible. Compliment for |
Ah, sorry, looks like this is it. I didn't realize it actually makes a difference. |
So I guess with |
Yes, it does. The initial completion candidates for the prefix at the moment of the completion triggering are generated by the backend (cider-nrepl, compliment). Characters that are typed after that filter the candidates on the frontend (Emacs). Compliment doesn't support the completion as fuzzy as |
I don't think this should happen. I think it still happens on the frontend but with stricter rules than |
And the whole ordeal of moving from |
Can you please try the following with
What does it do? |
I'm pretty sure it's because |
Screen.Recording.2024-10-21.at.16.01.11.mov |
Interesting. On my machine, a different thing happens. Let me try to reproduce with |
I've just tried to reproduce with |
So, after evaluating Funny that setting |
That would be great to know indeed 😄. |
Too soon, actually it's |
Full snippet to make it work in (package-initialize)
(require 'cider)
(setopt completion-styles '(flex))
(setopt completion-ignore-case t) |
Thanks, I could reproduce that indeed. Still, this looks like a side effect. The problem comes from the fact that completion-at-point machinery looks through all candidates returned by the backend and tries to grow a common substring from them. It happens so for |
I agree it weird and confusing. I was able to find it just by enabling options from my config one by one. Maybe some emacs experts could shine some light on this. |
I'll take the liberty of merging this ASAP since the original issue is quite nasty. |
Should fix #3749.
Turns out the API of a custom completion style's "try-completion function" doesn't match Emacs' own
try-completion
because why the hell should it, right? The API expected from that function is also not documented anywhere.However, I've seen that
eglot
simply usesignore
instead of implementing that function and everything still works. I've verified locally that the completion is still operational withignore
there in both company-mode andM-x complete-symbol
.Asking @rrudakov to kindly verify the fix locally (you can replace the body of
cider-completion-try-completion
with just returning nil to verify).