Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'src/com.rs')
| -rw-r--r-- | src/com.rs | 47 |
1 files changed, 1 insertions, 46 deletions
@@ -8,7 +8,7 @@ use lsp_types::*; use serde::{Deserialize, Serialize}; use crate::FG; -use crate::menu::{Key, back, filter, next, score}; +use crate::menu::{Key, back, charc, filter, next, score}; use crate::text::{col, color_, set_a}; #[derive(Serialize, Deserialize)] @@ -75,57 +75,12 @@ pub fn s(completion: &Complete, c: usize, f: &str) -> Vec<Cell> { .skip(completion.vo) .take(N); - // let Some((s, x)) = i.next() else { - // return vec![]; - // }; - - // let mut q = Dq::<_, 13>::new((s, x)); - // for (s, x) in i { - // if q.first().0 <= s { - // q.push_front((s, x)); - // } - // } - - // fuzzy_aho_corasick::FuzzyAhoCorasickBuilder::new() - // .fuzzy( - // FuzzyLimits::new() - // .insertions(20) - // .deletions(2) - // .edits(4) - // .substitutions(5) - // .swaps(3), - // .penalties(FuzzyPenalties { - // ) - // insertion: 0.0, - // deletion: 1.0, - // substitution: 0.5, - // swap: 0.5, - // }) - // .build( - // y.iter().map(|x| x.filter_text.as_deref().unwrap_or(&x.label)), - // ) - // .search(filter, 0.25) - // .into_iter() - // .map(|x| &y[x.pattern_index]) - // // .take(13); - // // for x in y - // // .iter() - // // .filter(|x| { - // // x.filter_text - // // .as_deref() - // // .unwrap_or(&x.label) - // // .starts_with(filter) - // // }) - // .take(13) i.for_each(|((_, x, indices), i)| { r(x, c, i == completion.selection, &indices, &mut out) }); out } -fn charc(c: &str) -> usize { - c.chars().count() -} #[implicit_fn::implicit_fn] fn r( x: &CompletionItem, |