diff options
Diffstat (limited to 'crates/ra_assists/src/assists')
-rw-r--r-- | crates/ra_assists/src/assists/auto_import.rs | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/crates/ra_assists/src/assists/auto_import.rs b/crates/ra_assists/src/assists/auto_import.rs index e908ab1fc..2068256b0 100644 --- a/crates/ra_assists/src/assists/auto_import.rs +++ b/crates/ra_assists/src/assists/auto_import.rs | |||
@@ -63,16 +63,12 @@ pub(crate) fn auto_import<F: ImportsLocator>( | |||
63 | return None; | 63 | return None; |
64 | } | 64 | } |
65 | 65 | ||
66 | ctx.add_assist_group( | 66 | ctx.add_assist_group(AssistId("auto_import"), format!("Import {}", name_to_import), || { |
67 | AssistId("auto_import"), | 67 | proposed_imports |
68 | format!("Import {}", path_to_import_syntax), | 68 | .into_iter() |
69 | || { | 69 | .map(|import| import_to_action(import, &position, &path_to_import_syntax)) |
70 | proposed_imports | 70 | .collect() |
71 | .into_iter() | 71 | }) |
72 | .map(|import| import_to_action(import, &position, &path_to_import_syntax)) | ||
73 | .collect() | ||
74 | }, | ||
75 | ) | ||
76 | } | 72 | } |
77 | 73 | ||
78 | fn import_to_action(import: ModPath, position: &SyntaxNode, anchor: &SyntaxNode) -> ActionBuilder { | 74 | fn import_to_action(import: ModPath, position: &SyntaxNode, anchor: &SyntaxNode) -> ActionBuilder { |