diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-02-03 14:34:16 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2020-02-03 14:34:16 +0000 |
commit | 056a01502b7a072f16db0e81eeb99ed8508d2ee6 (patch) | |
tree | 37407261123526397fe91c2fc6fec801dcbfa3c0 /crates/ra_assists/src | |
parent | c57ed0cfb29bc2b311299eebb4f7820a31068a37 (diff) | |
parent | bfbc5e2d37fa28ed4f5f1c2c2c4de3b5ad966ec3 (diff) |
Merge #2997
2997: Use proper import name in the label r=matklad a=SomeoneToIgnore
Co-authored-by: Kirill Bulatov <[email protected]>
Diffstat (limited to 'crates/ra_assists/src')
-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 { |