mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 06:41:48 +00:00
Fix merge-imports assist for wildcard imports
This commit is contained in:
parent
75f6ab208a
commit
f016d8b900
3 changed files with 36 additions and 2 deletions
|
@ -29,12 +29,17 @@ pub fn use_tree(
|
|||
path: ast::Path,
|
||||
use_tree_list: Option<ast::UseTreeList>,
|
||||
alias: Option<ast::Alias>,
|
||||
add_star: bool,
|
||||
) -> ast::UseTree {
|
||||
let mut buf = "use ".to_string();
|
||||
buf += &path.syntax().to_string();
|
||||
if let Some(use_tree_list) = use_tree_list {
|
||||
buf += &format!("::{}", use_tree_list);
|
||||
}
|
||||
if add_star {
|
||||
buf += "::*";
|
||||
}
|
||||
|
||||
if let Some(alias) = alias {
|
||||
buf += &format!(" {}", alias);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue