Use proper import name in the label

This commit is contained in:
Kirill Bulatov 2020-02-03 15:44:28 +02:00
parent 834fcecd31
commit bfbc5e2d37

View file

@ -63,16 +63,12 @@ pub(crate) fn auto_import<F: ImportsLocator>(
return None; return None;
} }
ctx.add_assist_group( ctx.add_assist_group(AssistId("auto_import"), format!("Import {}", name_to_import), || {
AssistId("auto_import"),
format!("Import {}", path_to_import_syntax),
|| {
proposed_imports proposed_imports
.into_iter() .into_iter()
.map(|import| import_to_action(import, &position, &path_to_import_syntax)) .map(|import| import_to_action(import, &position, &path_to_import_syntax))
.collect() .collect()
}, })
)
} }
fn import_to_action(import: ModPath, position: &SyntaxNode, anchor: &SyntaxNode) -> ActionBuilder { fn import_to_action(import: ModPath, position: &SyntaxNode, anchor: &SyntaxNode) -> ActionBuilder {