aboutsummaryrefslogtreecommitdiff
path: root/crates/completion/src
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-12-10 14:53:59 +0000
committerGitHub <[email protected]>2020-12-10 14:53:59 +0000
commit83aa6fbd1ef7fd7faf27d8f7fd8679cb85a8097a (patch)
tree164ef144e07ed4f24c751355b735169878468789 /crates/completion/src
parent1341a98f0551edf3a445c40507ab1abb3d7c71bb (diff)
parent17f236c2b041de7abd8ec3be208b8eff75fd7ffb (diff)
Merge #6797
6797: Normalize spelling to American English r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/completion/src')
-rw-r--r--crates/completion/src/completions/unqualified_path.rs10
-rw-r--r--crates/completion/src/config.rs6
-rw-r--r--crates/completion/src/item.rs6
-rw-r--r--crates/completion/src/lib.rs2
4 files changed, 12 insertions, 12 deletions
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
45 }); 45 });
46 46
47 if ctx.config.enable_autoimport_completions && ctx.config.resolve_additional_edits_lazily() { 47 if ctx.config.enable_autoimport_completions && ctx.config.resolve_additional_edits_lazily() {
48 fuzzy_completion(acc, ctx).unwrap_or_default() 48 fuzzy_completion(acc, ctx);
49 } 49 }
50} 50}
51 51
@@ -100,10 +100,10 @@ fn complete_enum_variants(acc: &mut Completions, ctx: &CompletionContext, ty: &T
100// To avoid an excessive amount of the results returned, completion input is checked for inclusion in the identifiers only 100// To avoid an excessive amount of the results returned, completion input is checked for inclusion in the identifiers only
101// (i.e. in `HashMap` in the `std::collections::HashMap` path), also not in the module indentifiers. 101// (i.e. in `HashMap` in the `std::collections::HashMap` path), also not in the module indentifiers.
102// 102//
103// .Merge Behaviour 103// .Merge Behavior
104// 104//
105// It is possible to configure how use-trees are merged with the `importMergeBehaviour` setting. 105// It is possible to configure how use-trees are merged with the `importMergeBehavior` setting.
106// Mimics the corresponding behaviour of the `Auto Import` feature. 106// Mimics the corresponding behavior of the `Auto Import` feature.
107// 107//
108// .LSP and performance implications 108// .LSP and performance implications
109// 109//
@@ -150,7 +150,7 @@ fn fuzzy_completion(acc: &mut Completions, ctx: &CompletionContext) -> Option<()
150 ImportEdit { 150 ImportEdit {
151 import_path: import_path.clone(), 151 import_path: import_path.clone(),
152 import_scope: import_scope.clone(), 152 import_scope: import_scope.clone(),
153 merge_behaviour: ctx.config.merge, 153 merge_behavior: ctx.config.merge,
154 }, 154 },
155 &definition, 155 &definition,
156 ) 156 )
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 @@
4//! module, and we use to statically check that we only produce snippet 4//! module, and we use to statically check that we only produce snippet
5//! completions if we are allowed to. 5//! completions if we are allowed to.
6 6
7use ide_db::helpers::insert_use::MergeBehaviour; 7use ide_db::helpers::insert_use::MergeBehavior;
8use rustc_hash::FxHashSet; 8use rustc_hash::FxHashSet;
9 9
10#[derive(Clone, Debug, PartialEq, Eq)] 10#[derive(Clone, Debug, PartialEq, Eq)]
@@ -14,7 +14,7 @@ pub struct CompletionConfig {
14 pub add_call_parenthesis: bool, 14 pub add_call_parenthesis: bool,
15 pub add_call_argument_snippets: bool, 15 pub add_call_argument_snippets: bool,
16 pub snippet_cap: Option<SnippetCap>, 16 pub snippet_cap: Option<SnippetCap>,
17 pub merge: Option<MergeBehaviour>, 17 pub merge: Option<MergeBehavior>,
18 /// A set of capabilities, enabled on the client and supported on the server. 18 /// A set of capabilities, enabled on the client and supported on the server.
19 pub active_resolve_capabilities: FxHashSet<CompletionResolveCapability>, 19 pub active_resolve_capabilities: FxHashSet<CompletionResolveCapability>,
20} 20}
@@ -56,7 +56,7 @@ impl Default for CompletionConfig {
56 add_call_parenthesis: true, 56 add_call_parenthesis: true,
57 add_call_argument_snippets: true, 57 add_call_argument_snippets: true,
58 snippet_cap: Some(SnippetCap { _private: () }), 58 snippet_cap: Some(SnippetCap { _private: () }),
59 merge: Some(MergeBehaviour::Full), 59 merge: Some(MergeBehavior::Full),
60 active_resolve_capabilities: FxHashSet::default(), 60 active_resolve_capabilities: FxHashSet::default(),
61 } 61 }
62 } 62 }
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;
4 4
5use hir::{Documentation, ModPath, Mutability}; 5use hir::{Documentation, ModPath, Mutability};
6use ide_db::helpers::{ 6use ide_db::helpers::{
7 insert_use::{self, ImportScope, MergeBehaviour}, 7 insert_use::{self, ImportScope, MergeBehavior},
8 mod_path_to_ast, 8 mod_path_to_ast,
9}; 9};
10use syntax::{algo, TextRange}; 10use syntax::{algo, TextRange};
@@ -271,7 +271,7 @@ impl CompletionItem {
271pub struct ImportEdit { 271pub struct ImportEdit {
272 pub import_path: ModPath, 272 pub import_path: ModPath,
273 pub import_scope: ImportScope, 273 pub import_scope: ImportScope,
274 pub merge_behaviour: Option<MergeBehaviour>, 274 pub merge_behavior: Option<MergeBehavior>,
275} 275}
276 276
277impl ImportEdit { 277impl ImportEdit {
@@ -283,7 +283,7 @@ impl ImportEdit {
283 let rewriter = insert_use::insert_use( 283 let rewriter = insert_use::insert_use(
284 &self.import_scope, 284 &self.import_scope,
285 mod_path_to_ast(&self.import_path), 285 mod_path_to_ast(&self.import_path),
286 self.merge_behaviour, 286 self.merge_behavior,
287 ); 287 );
288 let old_ast = rewriter.rewrite_root()?; 288 let old_ast = rewriter.rewrite_root()?;
289 let mut import_insert = TextEdit::builder(); 289 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(
153 }) 153 })
154 .find(|mod_path| mod_path.to_string() == full_import_path)?; 154 .find(|mod_path| mod_path.to_string() == full_import_path)?;
155 155
156 ImportEdit { import_path, import_scope, merge_behaviour: config.merge } 156 ImportEdit { import_path, import_scope, merge_behavior: config.merge }
157 .to_text_edit() 157 .to_text_edit()
158 .map(|edit| vec![edit]) 158 .map(|edit| vec![edit])
159} 159}