mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 13:25:09 +00:00
Reduce some more code duplication
This commit is contained in:
parent
2cd2947bf8
commit
83121efcd5
5 changed files with 76 additions and 94 deletions
|
@ -160,6 +160,12 @@ impl<'a> Render<'a> {
|
|||
let item = render_fn(self.ctx, import_to_add, Some(local_name), *func);
|
||||
return Some(item);
|
||||
}
|
||||
ScopeDef::ModuleDef(Variant(_))
|
||||
if self.ctx.completion.is_pat_binding_or_const
|
||||
| self.ctx.completion.is_irrefutable_pat_binding =>
|
||||
{
|
||||
CompletionItemKind::EnumVariant
|
||||
}
|
||||
ScopeDef::ModuleDef(Variant(var)) => {
|
||||
let item = render_variant(self.ctx, import_to_add, Some(local_name), *var, None);
|
||||
return Some(item);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue