1pub mod clangd;
2pub mod skim;
3mod util;
4
5#[cfg(not(feature = "compact"))]
6type IndexType = usize;
7#[cfg(not(feature = "compact"))]
8type ScoreType = i64;
9
10#[cfg(feature = "compact")]
11type IndexType = u32;
12#[cfg(feature = "compact")]
13type ScoreType = i32;
14
15pub trait FuzzyMatcher: Send + Sync {
16 fn fuzzy_indices(&self, choice: &str, pattern: &str) -> Option<(ScoreType, Vec<IndexType>)>;
18
19 fn fuzzy_match(&self, choice: &str, pattern: &str) -> Option<ScoreType> {
21 self.fuzzy_indices(choice, pattern).map(|(score, _)| score)
22 }
23}