mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 21:35:20 +00:00
Unify naming
This commit is contained in:
parent
c01ef6eaba
commit
7e217a42e1
13 changed files with 90 additions and 103 deletions
|
@ -55,13 +55,12 @@ impl<'a> EnumRender<'a> {
|
|||
}
|
||||
|
||||
fn render(self, import_to_add: Option<ImportEdit>) -> CompletionItem {
|
||||
let mut builder = CompletionItem::new(
|
||||
let mut item = CompletionItem::new(
|
||||
CompletionKind::Reference,
|
||||
self.ctx.source_range(),
|
||||
self.qualified_name.clone(),
|
||||
);
|
||||
builder
|
||||
.kind(SymbolKind::Variant)
|
||||
item.kind(SymbolKind::Variant)
|
||||
.set_documentation(self.variant.docs(self.ctx.db()))
|
||||
.set_deprecated(self.ctx.is_deprecated(self.variant))
|
||||
.add_import(import_to_add)
|
||||
|
@ -70,12 +69,12 @@ impl<'a> EnumRender<'a> {
|
|||
if self.variant_kind == StructKind::Tuple {
|
||||
cov_mark::hit!(inserts_parens_for_tuple_enums);
|
||||
let params = Params::Anonymous(self.variant.fields(self.ctx.db()).len());
|
||||
builder.add_call_parens(self.ctx.completion, self.short_qualified_name, params);
|
||||
item.add_call_parens(self.ctx.completion, self.short_qualified_name, params);
|
||||
} else if self.path.is_some() {
|
||||
builder.lookup_by(self.short_qualified_name);
|
||||
item.lookup_by(self.short_qualified_name);
|
||||
}
|
||||
|
||||
builder.build()
|
||||
item.build()
|
||||
}
|
||||
|
||||
fn detail(&self) -> String {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue