pub struct FuzzyMatcher;Expand description
match:fuzzy. Five-tier scoring (Exact → Prefix → Word-
boundary subsequence → Substring → Fuzzy-subsequence with
skip-decay).
Slice 3c.cmdline-completion-fuzzy-shared follow-up: this
matcher used to carry its own single-tier subsequence-with-
gap-density algorithm. That diverged from the picker’s filter
loop and from the insert-mode FuzzyInsertMatcher, both of
which delegated to the free function crate::fuzzy_match
in insert.rs. The divergence produced exactly the symptom
the user reported on the GPUI cmdline: :desc<Tab> returned
a noisy fuzzy net (all candidates containing d-e-s-c as a
subsequence) with no clear winner, because there was no
prefix tier to lift describe-* above unrelated matches.
Collapsing the two impls makes cmdline completion behave identically to the picker’s filter and the insert-mode matcher: prefix matches dominate (Tier 2, score 800), with fuzzy subsequence (Tier 5, score ≤200) as the last-resort tier. The picker / insert / cmdline now share one algorithm, one set of tests, one definition of “fuzzy”.
Trait Implementations§
Source§impl CandidateMatcher for FuzzyMatcher
impl CandidateMatcher for FuzzyMatcher
Source§fn matches(
&self,
query: &str,
candidate: &RawCandidate,
) -> Option<(MatchScore, Vec<Range<usize>>)>
fn matches( &self, query: &str, candidate: &RawCandidate, ) -> Option<(MatchScore, Vec<Range<usize>>)>
query. None means “no match”
(filter out). The byte ranges record which parts of
candidate.text the matcher consumed – the renderer paints
these with the match-face style.