diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-04-09 12:00:55 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-04-09 12:00:55 +0100 |
commit | cfc127f52988cf4f95797cb355398e3af32632aa (patch) | |
tree | a974bfe4160a0cb0d49146b239d68cdb99a6566d /crates/ra_assists/src/handlers/merge_imports.rs | |
parent | 85956932872481cf4813c5e7794d981a9edb4623 (diff) | |
parent | 689661c95968cb438f8bd1f10ce0ee096287741b (diff) |
Merge #3911
3911: Genrate token accessors r=matklad a=matklad
bors r+
🤖
Co-authored-by: Luca Barbieri <[email protected]>
Co-authored-by: Aleksey Kladov <[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 5d4b74e56..f8b3ddb4e 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, Direction, InsertPosition, SyntaxElement, T, | 6 | AstNode, AstToken, 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()?.into()); | 85 | let pos = InsertPosition::Before(use_tree_list.r_curly()?.syntax().clone().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 | } |