diff options
author | Benjamin Coenen <[email protected]> | 2020-04-11 21:54:22 +0100 |
---|---|---|
committer | Benjamin Coenen <[email protected]> | 2020-04-11 22:45:09 +0100 |
commit | 93bfc2d05d36a47dc05a1799210327473d702dbc (patch) | |
tree | dee25e78b24b5d1b23d73ae1009bddbd060927cf /crates/ra_assists/src/handlers/merge_imports.rs | |
parent | d42346fed61f706d68fe888631a41ea5f2752d7f (diff) | |
parent | fd06fe7b13045185ab4e630b0044aa9d8bbcdf8a (diff) |
Improve autocompletion by looking on the type and name
Signed-off-by: Benjamin Coenen <[email protected]>
Diffstat (limited to 'crates/ra_assists/src/handlers/merge_imports.rs')
-rw-r--r-- | crates/ra_assists/src/handlers/merge_imports.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ra_assists/src/handlers/merge_imports.rs b/crates/ra_assists/src/handlers/merge_imports.rs index f8b3ddb4e..0958f52f1 100644 --- a/crates/ra_assists/src/handlers/merge_imports.rs +++ b/crates/ra_assists/src/handlers/merge_imports.rs | |||
@@ -3,7 +3,7 @@ use std::iter::successors; | |||
3 | use ra_syntax::{ | 3 | use ra_syntax::{ |
4 | algo::{neighbor, SyntaxRewriter}, | 4 | algo::{neighbor, SyntaxRewriter}, |
5 | ast::{self, edit::AstNodeEdit, make}, | 5 | ast::{self, edit::AstNodeEdit, make}, |
6 | AstNode, AstToken, Direction, InsertPosition, SyntaxElement, T, | 6 | AstNode, Direction, InsertPosition, SyntaxElement, T, |
7 | }; | 7 | }; |
8 | 8 | ||
9 | use crate::{Assist, AssistCtx, AssistId}; | 9 | use crate::{Assist, AssistCtx, AssistId}; |
@@ -82,7 +82,7 @@ fn try_merge_trees(old: &ast::UseTree, new: &ast::UseTree) -> Option<ast::UseTre | |||
82 | .filter(|it| it.kind() != T!['{'] && it.kind() != T!['}']), | 82 | .filter(|it| it.kind() != T!['{'] && it.kind() != T!['}']), |
83 | ); | 83 | ); |
84 | let use_tree_list = lhs.use_tree_list()?; | 84 | let use_tree_list = lhs.use_tree_list()?; |
85 | let pos = InsertPosition::Before(use_tree_list.r_curly()?.syntax().clone().into()); | 85 | let pos = InsertPosition::Before(use_tree_list.r_curly_token()?.into()); |
86 | let use_tree_list = use_tree_list.insert_children(pos, to_insert); | 86 | let use_tree_list = use_tree_list.insert_children(pos, to_insert); |
87 | Some(lhs.with_use_tree_list(use_tree_list)) | 87 | Some(lhs.with_use_tree_list(use_tree_list)) |
88 | } | 88 | } |