Merge #2965
2965: Improve auto import message r=kiljacken a=lnicola Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
This commit is contained in:
commit
fc0a8c14dc
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user