mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-11-15 17:28:09 +00:00
Improve auto import message
This commit is contained in:
parent
dc713ea21b
commit
0fdca457df
1 changed files with 10 additions and 6 deletions
|
@ -64,12 +64,16 @@ pub(crate) fn auto_import<F: ImportsLocator>(
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx.add_assist_group(AssistId("auto_import"), "auto import", || {
|
ctx.add_assist_group(
|
||||||
|
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: String, position: &SyntaxNode, anchor: &SyntaxNode) -> ActionBuilder {
|
fn import_to_action(import: String, position: &SyntaxNode, anchor: &SyntaxNode) -> ActionBuilder {
|
||||||
|
|
Loading…
Reference in a new issue