mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-13 21:54:42 +00:00
Use proper import name in the label
This commit is contained in:
parent
834fcecd31
commit
bfbc5e2d37
1 changed files with 6 additions and 10 deletions
|
@ -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"),
|
proposed_imports
|
||||||
format!("Import {}", path_to_import_syntax),
|
.into_iter()
|
||||||
|| {
|
.map(|import| import_to_action(import, &position, &path_to_import_syntax))
|
||||||
proposed_imports
|
.collect()
|
||||||
.into_iter()
|
})
|
||||||
.map(|import| import_to_action(import, &position, &path_to_import_syntax))
|
|
||||||
.collect()
|
|
||||||
},
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn import_to_action(import: ModPath, position: &SyntaxNode, anchor: &SyntaxNode) -> ActionBuilder {
|
fn import_to_action(import: ModPath, position: &SyntaxNode, anchor: &SyntaxNode) -> ActionBuilder {
|
||||||
|
|
Loading…
Reference in a new issue