From a5ffe53c9d185d790388760dfe09f265e352b6bf Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 7 Apr 2020 13:19:57 +0200 Subject: [PATCH 1/2] Better naming for path completion --- crates/ra_ide/src/completion.rs | 8 ++++---- .../{complete_path.rs => complete_qualified_path.rs} | 0 .../{complete_scope.rs => complete_unqualified_path.rs} | 0 3 files changed, 4 insertions(+), 4 deletions(-) rename crates/ra_ide/src/completion/{complete_path.rs => complete_qualified_path.rs} (100%) rename crates/ra_ide/src/completion/{complete_scope.rs => complete_unqualified_path.rs} (100%) diff --git a/crates/ra_ide/src/completion.rs b/crates/ra_ide/src/completion.rs index 93157bbba6..c9ba1d4ee4 100644 --- a/crates/ra_ide/src/completion.rs +++ b/crates/ra_ide/src/completion.rs @@ -10,8 +10,8 @@ mod complete_pattern; mod complete_fn_param; mod complete_keyword; mod complete_snippet; -mod complete_path; -mod complete_scope; +mod complete_qualified_path; +mod complete_unqualified_path; mod complete_postfix; mod complete_macro_in_item_position; mod complete_trait_impl; @@ -85,8 +85,8 @@ pub(crate) fn completions( complete_keyword::complete_use_tree_keyword(&mut acc, &ctx); complete_snippet::complete_expr_snippet(&mut acc, &ctx); complete_snippet::complete_item_snippet(&mut acc, &ctx); - complete_path::complete_path(&mut acc, &ctx); - complete_scope::complete_scope(&mut acc, &ctx); + complete_qualified_path::complete_path(&mut acc, &ctx); + complete_unqualified_path::complete_scope(&mut acc, &ctx); complete_dot::complete_dot(&mut acc, &ctx); complete_record::complete_record(&mut acc, &ctx); complete_pattern::complete_pattern(&mut acc, &ctx); diff --git a/crates/ra_ide/src/completion/complete_path.rs b/crates/ra_ide/src/completion/complete_qualified_path.rs similarity index 100% rename from crates/ra_ide/src/completion/complete_path.rs rename to crates/ra_ide/src/completion/complete_qualified_path.rs diff --git a/crates/ra_ide/src/completion/complete_scope.rs b/crates/ra_ide/src/completion/complete_unqualified_path.rs similarity index 100% rename from crates/ra_ide/src/completion/complete_scope.rs rename to crates/ra_ide/src/completion/complete_unqualified_path.rs From 021556043425d7b11800532bc06e5d49514c1347 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 7 Apr 2020 13:20:41 +0200 Subject: [PATCH 2/2] Better naming for scope completion --- crates/ra_ide/src/completion.rs | 4 ++-- crates/ra_ide/src/completion/complete_qualified_path.rs | 2 +- crates/ra_ide/src/completion/complete_unqualified_path.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/ra_ide/src/completion.rs b/crates/ra_ide/src/completion.rs index c9ba1d4ee4..4a1a2a04a7 100644 --- a/crates/ra_ide/src/completion.rs +++ b/crates/ra_ide/src/completion.rs @@ -85,8 +85,8 @@ pub(crate) fn completions( complete_keyword::complete_use_tree_keyword(&mut acc, &ctx); complete_snippet::complete_expr_snippet(&mut acc, &ctx); complete_snippet::complete_item_snippet(&mut acc, &ctx); - complete_qualified_path::complete_path(&mut acc, &ctx); - complete_unqualified_path::complete_scope(&mut acc, &ctx); + complete_qualified_path::complete_qualified_path(&mut acc, &ctx); + complete_unqualified_path::complete_unqualified_path(&mut acc, &ctx); complete_dot::complete_dot(&mut acc, &ctx); complete_record::complete_record(&mut acc, &ctx); complete_pattern::complete_pattern(&mut acc, &ctx); diff --git a/crates/ra_ide/src/completion/complete_qualified_path.rs b/crates/ra_ide/src/completion/complete_qualified_path.rs index 3ed2ae2b63..d98523406a 100644 --- a/crates/ra_ide/src/completion/complete_qualified_path.rs +++ b/crates/ra_ide/src/completion/complete_qualified_path.rs @@ -6,7 +6,7 @@ use test_utils::tested_by; use crate::completion::{CompletionContext, Completions}; -pub(super) fn complete_path(acc: &mut Completions, ctx: &CompletionContext) { +pub(super) fn complete_qualified_path(acc: &mut Completions, ctx: &CompletionContext) { let path = match &ctx.path_prefix { Some(path) => path.clone(), _ => return, diff --git a/crates/ra_ide/src/completion/complete_unqualified_path.rs b/crates/ra_ide/src/completion/complete_unqualified_path.rs index 665597e4cb..efde9bf731 100644 --- a/crates/ra_ide/src/completion/complete_unqualified_path.rs +++ b/crates/ra_ide/src/completion/complete_unqualified_path.rs @@ -2,7 +2,7 @@ use crate::completion::{CompletionContext, Completions}; -pub(super) fn complete_scope(acc: &mut Completions, ctx: &CompletionContext) { +pub(super) fn complete_unqualified_path(acc: &mut Completions, ctx: &CompletionContext) { if !(ctx.is_trivial_path && !ctx.is_pat_binding_or_const) { return; }