diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-02-01 11:10:50 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2020-02-01 11:10:50 +0000 |
commit | fc0a8c14dcc6404c5d2ebb76488d6ebd894926c8 (patch) | |
tree | ccca5bdeaa2b66e476535d4ebdbef87a3d788ce5 /crates | |
parent | 12ac379c6c47be389499aa4b37c754cc478945cd (diff) | |
parent | 0fdca457df6baae3821fb026a1c0a85bca6642d7 (diff) |
Merge #2965
2965: Improve auto import message r=kiljacken a=lnicola
Co-authored-by: Laurențiu Nicola <[email protected]>
Diffstat (limited to 'crates')
-rw-r--r-- | crates/ra_assists/src/assists/auto_import.rs | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/crates/ra_assists/src/assists/auto_import.rs b/crates/ra_assists/src/assists/auto_import.rs index 69126a1c9..932a52bff 100644 --- a/crates/ra_assists/src/assists/auto_import.rs +++ b/crates/ra_assists/src/assists/auto_import.rs | |||
@@ -64,12 +64,16 @@ pub(crate) fn auto_import<F: ImportsLocator>( | |||
64 | return None; | 64 | return None; |
65 | } | 65 | } |
66 | 66 | ||
67 | ctx.add_assist_group(AssistId("auto_import"), "auto import", || { | 67 | ctx.add_assist_group( |
68 | proposed_imports | 68 | AssistId("auto_import"), |
69 | .into_iter() | 69 | format!("Import {}", path_to_import_syntax), |
70 | .map(|import| import_to_action(import, &position, &path_to_import_syntax)) | 70 | || { |
71 | .collect() | 71 | proposed_imports |
72 | }) | 72 | .into_iter() |
73 | .map(|import| import_to_action(import, &position, &path_to_import_syntax)) | ||
74 | .collect() | ||
75 | }, | ||
76 | ) | ||
73 | } | 77 | } |
74 | 78 | ||
75 | fn import_to_action(import: String, position: &SyntaxNode, anchor: &SyntaxNode) -> ActionBuilder { | 79 | fn import_to_action(import: String, position: &SyntaxNode, anchor: &SyntaxNode) -> ActionBuilder { |