Skip to main content

Module matchers

Module matchers 

Source
Expand description

Built-in matchers (DESIGN.md §5.11.3).

Three shipped:

  • PrefixMatcher – query is a prefix of the candidate text. Case-insensitive when ctx.case_sensitive is false (the default for cmdline use).
  • SubstringMatcher – query appears anywhere in the candidate text.
  • FuzzyMatcher – subsequence match (each char of the query appears in order in the candidate, possibly with skips). Score decays with the number of skipped chars; match_ranges records exactly which bytes the matcher consumed (so the renderer can paint them).

Structs§

FuzzyDisplayMatcher
match:fuzzy-display. Same 5-tier algorithm as FuzzyMatcher but matches against candidate.display instead of candidate.text.
FuzzyMatcher
match:fuzzy. Five-tier scoring (Exact → Prefix → Word- boundary subsequence → Substring → Fuzzy-subsequence with skip-decay).
OrderlessDisplayMatcher
match:orderless-display. FuzzyDisplayMatcher with the query read as a set of whitespace-separated components rather than one token — see crate::orderless for the syntax and scoring.
PrefixMatcher
match:prefix. Default v1 matcher.
SubstringMatcher
match:substring. Returns lower score than prefix.