mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-11-15 09:27:27 +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;
|
||||
}
|
||||
|
||||
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…
Reference in a new issue