diff options
Diffstat (limited to 'crates/ra_assists/src')
4 files changed, 8 insertions, 8 deletions
diff --git a/crates/ra_assists/src/handlers/auto_import.rs b/crates/ra_assists/src/handlers/auto_import.rs index 947be3b9b..01e7b7a44 100644 --- a/crates/ra_assists/src/handlers/auto_import.rs +++ b/crates/ra_assists/src/handlers/auto_import.rs | |||
@@ -92,7 +92,7 @@ impl AutoImportAssets { | |||
92 | 92 | ||
93 | fn for_regular_path(path_under_caret: ast::Path, ctx: &AssistContext) -> Option<Self> { | 93 | fn for_regular_path(path_under_caret: ast::Path, ctx: &AssistContext) -> Option<Self> { |
94 | let syntax_under_caret = path_under_caret.syntax().to_owned(); | 94 | let syntax_under_caret = path_under_caret.syntax().to_owned(); |
95 | if syntax_under_caret.ancestors().find_map(ast::UseItem::cast).is_some() { | 95 | if syntax_under_caret.ancestors().find_map(ast::Use::cast).is_some() { |
96 | return None; | 96 | return None; |
97 | } | 97 | } |
98 | 98 | ||
diff --git a/crates/ra_assists/src/handlers/merge_imports.rs b/crates/ra_assists/src/handlers/merge_imports.rs index 1beccb61c..c775fe25c 100644 --- a/crates/ra_assists/src/handlers/merge_imports.rs +++ b/crates/ra_assists/src/handlers/merge_imports.rs | |||
@@ -28,7 +28,7 @@ pub(crate) fn merge_imports(acc: &mut Assists, ctx: &AssistContext) -> Option<() | |||
28 | let mut rewriter = SyntaxRewriter::default(); | 28 | let mut rewriter = SyntaxRewriter::default(); |
29 | let mut offset = ctx.offset(); | 29 | let mut offset = ctx.offset(); |
30 | 30 | ||
31 | if let Some(use_item) = tree.syntax().parent().and_then(ast::UseItem::cast) { | 31 | if let Some(use_item) = tree.syntax().parent().and_then(ast::Use::cast) { |
32 | let (merged, to_delete) = next_prev() | 32 | let (merged, to_delete) = next_prev() |
33 | .filter_map(|dir| neighbor(&use_item, dir)) | 33 | .filter_map(|dir| neighbor(&use_item, dir)) |
34 | .filter_map(|it| Some((it.clone(), it.use_tree()?))) | 34 | .filter_map(|it| Some((it.clone(), it.use_tree()?))) |
diff --git a/crates/ra_assists/src/handlers/replace_qualified_name_with_use.rs b/crates/ra_assists/src/handlers/replace_qualified_name_with_use.rs index 3d51faa54..53496ede1 100644 --- a/crates/ra_assists/src/handlers/replace_qualified_name_with_use.rs +++ b/crates/ra_assists/src/handlers/replace_qualified_name_with_use.rs | |||
@@ -25,7 +25,7 @@ pub(crate) fn replace_qualified_name_with_use( | |||
25 | ) -> Option<()> { | 25 | ) -> Option<()> { |
26 | let path: ast::Path = ctx.find_node_at_offset()?; | 26 | let path: ast::Path = ctx.find_node_at_offset()?; |
27 | // We don't want to mess with use statements | 27 | // We don't want to mess with use statements |
28 | if path.syntax().ancestors().find_map(ast::UseItem::cast).is_some() { | 28 | if path.syntax().ancestors().find_map(ast::Use::cast).is_some() { |
29 | return None; | 29 | return None; |
30 | } | 30 | } |
31 | 31 | ||
@@ -85,7 +85,7 @@ fn shorten_paths(rewriter: &mut SyntaxRewriter<'static>, node: SyntaxNode, path: | |||
85 | match child { | 85 | match child { |
86 | // Don't modify `use` items, as this can break the `use` item when injecting a new | 86 | // Don't modify `use` items, as this can break the `use` item when injecting a new |
87 | // import into the use tree. | 87 | // import into the use tree. |
88 | ast::UseItem(_it) => continue, | 88 | ast::Use(_it) => continue, |
89 | // Don't descend into submodules, they don't have the same `use` items in scope. | 89 | // Don't descend into submodules, they don't have the same `use` items in scope. |
90 | ast::Module(_it) => continue, | 90 | ast::Module(_it) => continue, |
91 | 91 | ||
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( | |||
225 | current_use_tree | 225 | current_use_tree |
226 | .syntax() | 226 | .syntax() |
227 | .ancestors() | 227 | .ancestors() |
228 | .find_map(ast::UseItem::cast) | 228 | .find_map(ast::Use::cast) |
229 | .map(|it| it.syntax().clone()), | 229 | .map(|it| it.syntax().clone()), |
230 | true, | 230 | true, |
231 | ); | 231 | ); |
@@ -254,7 +254,7 @@ fn walk_use_tree_for_best_action( | |||
254 | current_use_tree | 254 | current_use_tree |
255 | .syntax() | 255 | .syntax() |
256 | .ancestors() | 256 | .ancestors() |
257 | .find_map(ast::UseItem::cast) | 257 | .find_map(ast::Use::cast) |
258 | .map(|it| it.syntax().clone()), | 258 | .map(|it| it.syntax().clone()), |
259 | true, | 259 | true, |
260 | ), | 260 | ), |
@@ -304,7 +304,7 @@ fn walk_use_tree_for_best_action( | |||
304 | current_use_tree | 304 | current_use_tree |
305 | .syntax() | 305 | .syntax() |
306 | .ancestors() | 306 | .ancestors() |
307 | .find_map(ast::UseItem::cast) | 307 | .find_map(ast::Use::cast) |
308 | .map(|it| it.syntax().clone()), | 308 | .map(|it| it.syntax().clone()), |
309 | true, | 309 | true, |
310 | ); | 310 | ); |
@@ -377,7 +377,7 @@ fn best_action_for_target( | |||
377 | let mut storage = Vec::with_capacity(16); // this should be the only allocation | 377 | let mut storage = Vec::with_capacity(16); // this should be the only allocation |
378 | let best_action = container | 378 | let best_action = container |
379 | .children() | 379 | .children() |
380 | .filter_map(ast::UseItem::cast) | 380 | .filter_map(ast::Use::cast) |
381 | .filter_map(|it| it.use_tree()) | 381 | .filter_map(|it| it.use_tree()) |
382 | .map(|u| walk_use_tree_for_best_action(&mut storage, None, u, target)) | 382 | .map(|u| walk_use_tree_for_best_action(&mut storage, None, u, target)) |
383 | .fold(None, |best, a| match best { | 383 | .fold(None, |best, a| match best { |