From 6cd2131cafd29ae17442efbcce652bd447576f27 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 30 Jul 2020 11:58:41 +0200 Subject: Rename Rename --- crates/ra_assists/src/utils/insert_use.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/ra_assists/src/utils/insert_use.rs') diff --git a/crates/ra_assists/src/utils/insert_use.rs b/crates/ra_assists/src/utils/insert_use.rs index 8c4f33e59..c05027eff 100644 --- a/crates/ra_assists/src/utils/insert_use.rs +++ b/crates/ra_assists/src/utils/insert_use.rs @@ -215,7 +215,7 @@ fn walk_use_tree_for_best_action( let prev_len = current_path_segments.len(); let tree_list = current_use_tree.use_tree_list(); - let alias = current_use_tree.alias(); + let alias = current_use_tree.rename(); let path = match current_use_tree.path() { Some(path) => path, -- cgit v1.2.3 From 9697d23cbe7b0ad897139b15f1b1ffe1cab6ad89 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 30 Jul 2020 14:12:04 +0200 Subject: Rename UseItem -> Use --- crates/ra_assists/src/utils/insert_use.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'crates/ra_assists/src/utils/insert_use.rs') diff --git a/crates/ra_assists/src/utils/insert_use.rs b/crates/ra_assists/src/utils/insert_use.rs index c05027eff..617afe2e9 100644 --- a/crates/ra_assists/src/utils/insert_use.rs +++ b/crates/ra_assists/src/utils/insert_use.rs @@ -225,7 +225,7 @@ fn walk_use_tree_for_best_action( current_use_tree .syntax() .ancestors() - .find_map(ast::UseItem::cast) + .find_map(ast::Use::cast) .map(|it| it.syntax().clone()), true, ); @@ -254,7 +254,7 @@ fn walk_use_tree_for_best_action( current_use_tree .syntax() .ancestors() - .find_map(ast::UseItem::cast) + .find_map(ast::Use::cast) .map(|it| it.syntax().clone()), true, ), @@ -304,7 +304,7 @@ fn walk_use_tree_for_best_action( current_use_tree .syntax() .ancestors() - .find_map(ast::UseItem::cast) + .find_map(ast::Use::cast) .map(|it| it.syntax().clone()), true, ); @@ -377,7 +377,7 @@ fn best_action_for_target( let mut storage = Vec::with_capacity(16); // this should be the only allocation let best_action = container .children() - .filter_map(ast::UseItem::cast) + .filter_map(ast::Use::cast) .filter_map(|it| it.use_tree()) .map(|u| walk_use_tree_for_best_action(&mut storage, None, u, target)) .fold(None, |best, a| match best { -- cgit v1.2.3 From 03a61134f22fae8574766313f6ffd39d1007c7fe Mon Sep 17 00:00:00 2001 From: Jacob Rothstein Date: Mon, 3 Aug 2020 12:17:05 -0700 Subject: do not add to `pub use` statements --- crates/ra_assists/src/utils/insert_use.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'crates/ra_assists/src/utils/insert_use.rs') diff --git a/crates/ra_assists/src/utils/insert_use.rs b/crates/ra_assists/src/utils/insert_use.rs index 617afe2e9..32780fceb 100644 --- a/crates/ra_assists/src/utils/insert_use.rs +++ b/crates/ra_assists/src/utils/insert_use.rs @@ -4,7 +4,7 @@ use hir::{self, ModPath}; use ra_syntax::{ - ast::{self, NameOwner}, + ast::{self, NameOwner, VisibilityOwner}, AstNode, Direction, SmolStr, SyntaxKind::{PATH, PATH_SEGMENT}, SyntaxNode, T, @@ -378,6 +378,7 @@ fn best_action_for_target( let best_action = container .children() .filter_map(ast::Use::cast) + .filter(|u| u.visibility().is_none()) .filter_map(|it| it.use_tree()) .map(|u| walk_use_tree_for_best_action(&mut storage, None, u, target)) .fold(None, |best, a| match best { -- cgit v1.2.3