pub struct FuzzyInsertMatcher;Expand description
Built-in fuzzy matcher tuned for Insert-mode completion.
Scoring tiers (descending):
| Tier | Meaning | Score base |
|---|---|---|
| Exact | query == text (case-insensitive) | 1000 |
| Prefix | text.starts_with(query) (case-insensitive) | 800 |
| Word boundary | All query chars match at word boundaries (camelCase / snake_case) | 600 |
| Substring | text.contains(query) (case-insensitive) | 400 |
| Subsequence | Each query char appears in order in text | 200 - skipped × 5 |
Empty query yields a uniform score of 100 – everything matches, sorted by per-source priority + ranker bonuses.
Returns None for non-matches (filtered out before the
ranker stage).
Implementations§
Trait Implementations§
Source§impl CandidateMatcher for FuzzyInsertMatcher
impl CandidateMatcher for FuzzyInsertMatcher
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>>)>
Score the candidate against
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.Source§impl Debug for FuzzyInsertMatcher
impl Debug for FuzzyInsertMatcher
Source§impl Default for FuzzyInsertMatcher
impl Default for FuzzyInsertMatcher
Source§fn default() -> FuzzyInsertMatcher
fn default() -> FuzzyInsertMatcher
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for FuzzyInsertMatcher
impl RefUnwindSafe for FuzzyInsertMatcher
impl Send for FuzzyInsertMatcher
impl Sync for FuzzyInsertMatcher
impl Unpin for FuzzyInsertMatcher
impl UnsafeUnpin for FuzzyInsertMatcher
impl UnwindSafe for FuzzyInsertMatcher
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more