Improve auto import message

This commit is contained in:
Laurențiu Nicola 2020-01-31 21:04:52 +02:00
parent dc713ea21b
commit 0fdca457df

View file

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