Closed okamsn closed 2 years ago
Related things to do:
prescient-sort-full-matches-first
for Selectrum. This was implemented in prescient-filter
, which assumes that prescient-sort
was run first. This can't be assumed for completion styles and I shouldn't have done that.sort-full-matches-first
works when Company-Prescient is disabled, but not when enabled.
The matching portions of candidates aren’t highlighted. That’s because company-capf is hard-coded to look for the completions-common-part face, and it only use one face, company-echo-common to highlight candidates.
Questions to answer:
prescient
style).prescient--anchored-quoted-regexp
(from orderless--anchored-quoted-regexp
) needed?
selectrum-refine-candidates-using-completions-styles
.sort-full-matches-first
in Company Prescient for Emacs less than 27. Company was re-arranging the propertized candidates before they got to the post-processing filter, since they didn't have an explicit sort order.company-prescient-sort-length-enable
for CAPFs in general.
In general:
@raxod502, do you have any thoughts on these things?
@minad, since this further enables https://github.com/minad/vertico/issues/237, would you please give this a once-over to see if anything is off? I haven't noticed anything yet, but I'm sure that there are cases I haven't considered.
I didn't try yet, but I have a few comments.
This looks wonderful, thank you.
I think all of the kinks have been worked out now. @minad and @raxod502, is there anything you want addressed/changed before I merge this?
Looks good!
Nope, go ahead!
This is still a WIP due to surrounding features, but it seems to work well enough. I'm making the PR now in case people want to point things out.This completion style can optionally modify a completion table's metadata to use
prescient.el
sorting, includingprescient-sort-full-matches-first
.prescient-primary-highlight
andprescient-secondary-highlight
. Add a function to apply them.prescient-completion-highlight-matches
andprescient-completion-enable-sort
.prescient-filter
handle completion tables.prescient-all-completions
andprescient-try-completion
, which useprescient-filter
.all-completions
inside ofprescient-filter
.prescient-sort-full-matches-first
outside ofprescient-filter
.prescient--completion-modify-sort
,prescient-sort-full-matches-first
, andprescient-completion-sort
.Logic:
prescient-all-completions
orprescient-try-completion
.prescient-filter
to filter candidates.prescient-all-completions
, but not inprescient-try-completion
.completion--nth-completion
?Since the built-in
flex
completion style modifies the sorting metadata to a function using completion input, this approach should be fine.