From 17f236c2b041de7abd8ec3be208b8eff75fd7ffb Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 10 Dec 2020 17:41:57 +0300 Subject: Normalize spelling to American English --- crates/completion/src/completions/unqualified_path.rs | 10 +++++----- crates/completion/src/config.rs | 6 +++--- crates/completion/src/item.rs | 6 +++--- crates/completion/src/lib.rs | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) (limited to 'crates/completion/src') diff --git a/crates/completion/src/completions/unqualified_path.rs b/crates/completion/src/completions/unqualified_path.rs index 4e4e2b36f..3372fb1a2 100644 --- a/crates/completion/src/completions/unqualified_path.rs +++ b/crates/completion/src/completions/unqualified_path.rs @@ -45,7 +45,7 @@ pub(crate) fn complete_unqualified_path(acc: &mut Completions, ctx: &CompletionC }); if ctx.config.enable_autoimport_completions && ctx.config.resolve_additional_edits_lazily() { - fuzzy_completion(acc, ctx).unwrap_or_default() + fuzzy_completion(acc, ctx); } } @@ -100,10 +100,10 @@ fn complete_enum_variants(acc: &mut Completions, ctx: &CompletionContext, ty: &T // To avoid an excessive amount of the results returned, completion input is checked for inclusion in the identifiers only // (i.e. in `HashMap` in the `std::collections::HashMap` path), also not in the module indentifiers. // -// .Merge Behaviour +// .Merge Behavior // -// It is possible to configure how use-trees are merged with the `importMergeBehaviour` setting. -// Mimics the corresponding behaviour of the `Auto Import` feature. +// It is possible to configure how use-trees are merged with the `importMergeBehavior` setting. +// Mimics the corresponding behavior of the `Auto Import` feature. // // .LSP and performance implications // @@ -150,7 +150,7 @@ fn fuzzy_completion(acc: &mut Completions, ctx: &CompletionContext) -> Option<() ImportEdit { import_path: import_path.clone(), import_scope: import_scope.clone(), - merge_behaviour: ctx.config.merge, + merge_behavior: ctx.config.merge, }, &definition, ) diff --git a/crates/completion/src/config.rs b/crates/completion/src/config.rs index 5175b9d69..30577dc11 100644 --- a/crates/completion/src/config.rs +++ b/crates/completion/src/config.rs @@ -4,7 +4,7 @@ //! module, and we use to statically check that we only produce snippet //! completions if we are allowed to. -use ide_db::helpers::insert_use::MergeBehaviour; +use ide_db::helpers::insert_use::MergeBehavior; use rustc_hash::FxHashSet; #[derive(Clone, Debug, PartialEq, Eq)] @@ -14,7 +14,7 @@ pub struct CompletionConfig { pub add_call_parenthesis: bool, pub add_call_argument_snippets: bool, pub snippet_cap: Option, - pub merge: Option, + pub merge: Option, /// A set of capabilities, enabled on the client and supported on the server. pub active_resolve_capabilities: FxHashSet, } @@ -56,7 +56,7 @@ impl Default for CompletionConfig { add_call_parenthesis: true, add_call_argument_snippets: true, snippet_cap: Some(SnippetCap { _private: () }), - merge: Some(MergeBehaviour::Full), + merge: Some(MergeBehavior::Full), active_resolve_capabilities: FxHashSet::default(), } } diff --git a/crates/completion/src/item.rs b/crates/completion/src/item.rs index bd94402d7..83166df4e 100644 --- a/crates/completion/src/item.rs +++ b/crates/completion/src/item.rs @@ -4,7 +4,7 @@ use std::fmt; use hir::{Documentation, ModPath, Mutability}; use ide_db::helpers::{ - insert_use::{self, ImportScope, MergeBehaviour}, + insert_use::{self, ImportScope, MergeBehavior}, mod_path_to_ast, }; use syntax::{algo, TextRange}; @@ -271,7 +271,7 @@ impl CompletionItem { pub struct ImportEdit { pub import_path: ModPath, pub import_scope: ImportScope, - pub merge_behaviour: Option, + pub merge_behavior: Option, } impl ImportEdit { @@ -283,7 +283,7 @@ impl ImportEdit { let rewriter = insert_use::insert_use( &self.import_scope, mod_path_to_ast(&self.import_path), - self.merge_behaviour, + self.merge_behavior, ); let old_ast = rewriter.rewrite_root()?; let mut import_insert = TextEdit::builder(); diff --git a/crates/completion/src/lib.rs b/crates/completion/src/lib.rs index f60f87243..6a4b3c167 100644 --- a/crates/completion/src/lib.rs +++ b/crates/completion/src/lib.rs @@ -153,7 +153,7 @@ pub fn resolve_completion_edits( }) .find(|mod_path| mod_path.to_string() == full_import_path)?; - ImportEdit { import_path, import_scope, merge_behaviour: config.merge } + ImportEdit { import_path, import_scope, merge_behavior: config.merge } .to_text_edit() .map(|edit| vec![edit]) } -- cgit v1.2.3