mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 22:31:43 +00:00
Make multiple import edits work for completions
This commit is contained in:
parent
046c85ef0c
commit
454ecd167c
17 changed files with 141 additions and 87 deletions
|
@ -212,7 +212,10 @@ fn render_resolution_(
|
|||
ctx.source_range(),
|
||||
local_name.to_string(),
|
||||
);
|
||||
item.kind(CompletionItemKind::UnresolvedReference).add_import(import_to_add);
|
||||
item.kind(CompletionItemKind::UnresolvedReference);
|
||||
if let Some(import_to_add) = import_to_add {
|
||||
item.add_import(import_to_add);
|
||||
}
|
||||
return Some(item.build());
|
||||
}
|
||||
};
|
||||
|
@ -258,9 +261,12 @@ fn render_resolution_(
|
|||
}
|
||||
}
|
||||
item.kind(kind)
|
||||
.add_import(import_to_add)
|
||||
.set_documentation(scope_def_docs(ctx.db(), resolution))
|
||||
.set_deprecated(scope_def_is_deprecated(&ctx, resolution));
|
||||
|
||||
if let Some(import_to_add) = import_to_add {
|
||||
item.add_import(import_to_add);
|
||||
}
|
||||
Some(item.build())
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue