-
Notifications
You must be signed in to change notification settings - Fork 200
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
All completions #733
All completions #733
Conversation
In ebda0b3, you haven't explained why you changed the body of the lambda passed to Meanwhile, for organizational reasons, I will close this PR. We can continue in the issue where we were discussing things before. |
The practical purpose is following the programmed completion specification to avoid a subtly broken CAPF table. If any code inserts a predicate anywhere, including these Specific example: suppose a simple completion predicate is inserted by the user which filters out the word If you are still concerned about passing (t
(funcall
(cond
((null action) 'try-completion)
((eq action t) 'all-completions)
(t 'test-completion))
string collection predicate)) |
See the discussion. I have reverted to your lambda in my branch which this PR tracks/tracked. |
@jdtsmith I've pushed the main "remove-if-not -> all-completions" commit. If you can provide a real example of predicate "subtle broken" things like you did for the |
OK, thanks. I must admit that I find your position on the predicate hard to comprehend. I presume you read the part in the link to programmed completion info that requires compliant CAPF dynamic functions to use the predicate to filter their results:
That is accomplished in eglot's case by simply passing the predicate on to the final fixed-table calls of try/test/all-completions. A real example from consult: it can map completion-at-point into completing-read in the minibuffer, and it uses the Does the absence of predicate compliance break any user's eglot setup? I don't know. Does remaining out of compliance with the CAPF spec make that a possibility? Absolutely. Obviously your call but that's my final $2e-2. Thanks for eglot, working well here. |
I think my position is pretty easy to comprehend. When you can show an actual benefic effect deriving from a code change that happens in what we can call reality, I'll do that change. Every change in Eglot happened from this principle, not because something sounded reasonable or good. The reality of adapting LSP to Emacs doesn't always marry perfectly with Emacs's ideal APIs. Emacs' idea of "prefix" is completely wasted here, among many other other LSP/Emacs quirks. Furthermore this is one of the hairiest and most often changed functions (you can see this from its history), that has to provide support to a zillion servers via a rather flimsy and somewhat ad-hoc protocol.
OK then, once you actually write this thing and it turns out you really needed that bit of code, we can revisit this, no problem. |
This uses all-completions to enable searching of candidates with
completion-regexp-list
, which CAPF collection functions are required to do (from elisp/basic completion info):It also ensures any predicate passed to the collection function is forwarded to try/test-completion.