diff options
author | Norbert Preining <norbert@preining.info> | 2023-06-08 03:01:59 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2023-06-08 03:01:59 +0000 |
commit | 538e6d6e7c75b7cca5470604811205f9dbd55c03 (patch) | |
tree | 4807afb694acc9e4ecff2d466d5e37788127d6fb /support/texlab/crates/texlab/src/features/completion | |
parent | 5c99135c06494b236cce7fd76e346851cf8c4408 (diff) |
CTAN sync 202306080301
Diffstat (limited to 'support/texlab/crates/texlab/src/features/completion')
3 files changed, 7 insertions, 7 deletions
diff --git a/support/texlab/crates/texlab/src/features/completion/builder.rs b/support/texlab/crates/texlab/src/features/completion/builder.rs index b325cd183b..bae7ebbfb7 100644 --- a/support/texlab/crates/texlab/src/features/completion/builder.rs +++ b/support/texlab/crates/texlab/src/features/completion/builder.rs @@ -51,7 +51,7 @@ impl<'a> CompletionBuilder<'a> { ) -> Self { let items = Vec::new(); let matcher: Box<dyn Matcher> = match context.workspace.config().completion.matcher { - MatchingAlgo::Skim => Box::new(SkimMatcherV2::default()), + MatchingAlgo::Skim => Box::<SkimMatcherV2>::default(), MatchingAlgo::SkimIgnoreCase => Box::new(SkimMatcherV2::default().ignore_case()), MatchingAlgo::Prefix => Box::new(matcher::Prefix), MatchingAlgo::PrefixIgnoreCase => Box::new(matcher::PrefixIgnoreCase), @@ -290,7 +290,7 @@ impl<'a> CompletionBuilder<'a> { ) -> Option<()> { let score = self .matcher - .score(&entry_type.name, &self.text_pattern[1..])?; + .score(entry_type.name, &self.text_pattern[1..])?; self.items.push(Item { range, @@ -303,7 +303,7 @@ impl<'a> CompletionBuilder<'a> { } pub fn field(&mut self, range: TextRange, field: &'a BibtexFieldType<'a>) -> Option<()> { - let score = self.matcher.score(&field.name, &self.text_pattern)?; + let score = self.matcher.score(field.name, &self.text_pattern)?; self.items.push(Item { range, data: Data::Field { field }, @@ -750,8 +750,8 @@ enum Data<'a> { impl<'db> Data<'db> { pub fn label<'this: 'db>(&'this self) -> &'db str { match self { - Self::EntryType { entry_type } => &entry_type.name, - Self::Field { field } => &field.name, + Self::EntryType { entry_type } => entry_type.name, + Self::Field { field } => field.name, Self::Argument { name, .. } => name, Self::BeginSnippet => "begin", Self::Citation { key, .. } => key, diff --git a/support/texlab/crates/texlab/src/features/completion/label.rs b/support/texlab/crates/texlab/src/features/completion/label.rs index 800c7b7581..be6e1b9ab7 100644 --- a/support/texlab/crates/texlab/src/features/completion/label.rs +++ b/support/texlab/crates/texlab/src/features/completion/label.rs @@ -40,7 +40,7 @@ pub fn complete<'db>( let header = rendered_label.detail(); let footer = match &rendered_label.object { - RenderedObject::Float { caption, .. } => Some(caption.clone()), + RenderedObject::Float { caption, .. } => Some(*caption), _ => None, }; diff --git a/support/texlab/crates/texlab/src/features/completion/matcher.rs b/support/texlab/crates/texlab/src/features/completion/matcher.rs index a2b1a45e6a..5d5c93b2b9 100644 --- a/support/texlab/crates/texlab/src/features/completion/matcher.rs +++ b/support/texlab/crates/texlab/src/features/completion/matcher.rs @@ -37,6 +37,6 @@ impl Matcher for PrefixIgnoreCase { } } - return Some(-(choice.len() as i32)); + Some(-(choice.len() as i32)) } } |