diff options
Diffstat (limited to 'crates/ra_assists/src')
-rw-r--r-- | crates/ra_assists/src/split_import.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/crates/ra_assists/src/split_import.rs b/crates/ra_assists/src/split_import.rs index 99088d9a5..a8feb67c8 100644 --- a/crates/ra_assists/src/split_import.rs +++ b/crates/ra_assists/src/split_import.rs | |||
@@ -10,7 +10,10 @@ pub(crate) fn split_import(mut ctx: AssistCtx<impl HirDatabase>) -> Option<Assis | |||
10 | let path = ast::Path::cast(colon_colon.parent())?; | 10 | let path = ast::Path::cast(colon_colon.parent())?; |
11 | let top_path = successors(Some(path), |it| it.parent_path()).last()?; | 11 | let top_path = successors(Some(path), |it| it.parent_path()).last()?; |
12 | 12 | ||
13 | let _use_tree = top_path.syntax().ancestors().find_map(ast::UseTree::cast)?; | 13 | let use_tree = top_path.syntax().ancestors().find_map(ast::UseTree::cast); |
14 | if use_tree.is_none() { | ||
15 | return None; | ||
16 | } | ||
14 | 17 | ||
15 | let l_curly = colon_colon.range().end(); | 18 | let l_curly = colon_colon.range().end(); |
16 | let r_curly = match top_path.syntax().parent().and_then(ast::UseTree::cast) { | 19 | let r_curly = match top_path.syntax().parent().and_then(ast::UseTree::cast) { |