mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 21:35:20 +00:00
Refactor the code
This commit is contained in:
parent
d9bd1f171d
commit
50e06ee95a
11 changed files with 48 additions and 34 deletions
|
@ -71,7 +71,10 @@ impl<'a> EnumVariantRender<'a> {
|
|||
.kind(CompletionItemKind::EnumVariant)
|
||||
.set_documentation(self.variant.docs(self.ctx.db()))
|
||||
.set_deprecated(self.ctx.is_deprecated(self.variant))
|
||||
.add_import(import_to_add, self.ctx.completion.config.should_resolve_immediately())
|
||||
.add_import(
|
||||
import_to_add,
|
||||
self.ctx.completion.config.should_resolve_additional_edits_immediately(),
|
||||
)
|
||||
.detail(self.detail());
|
||||
|
||||
if self.variant_kind == StructKind::Tuple {
|
||||
|
|
|
@ -47,7 +47,10 @@ impl<'a> FunctionRender<'a> {
|
|||
.set_deprecated(self.ctx.is_deprecated(self.func))
|
||||
.detail(self.detail())
|
||||
.add_call_parens(self.ctx.completion, self.name, params)
|
||||
.add_import(import_to_add, self.ctx.completion.config.should_resolve_immediately())
|
||||
.add_import(
|
||||
import_to_add,
|
||||
self.ctx.completion.config.should_resolve_additional_edits_immediately(),
|
||||
)
|
||||
.build()
|
||||
}
|
||||
|
||||
|
|
|
@ -50,7 +50,10 @@ impl<'a> MacroRender<'a> {
|
|||
.kind(CompletionItemKind::Macro)
|
||||
.set_documentation(self.docs.clone())
|
||||
.set_deprecated(self.ctx.is_deprecated(self.macro_))
|
||||
.add_import(import_to_add, self.ctx.completion.config.should_resolve_immediately())
|
||||
.add_import(
|
||||
import_to_add,
|
||||
self.ctx.completion.config.should_resolve_additional_edits_immediately(),
|
||||
)
|
||||
.detail(self.detail());
|
||||
|
||||
let needs_bang = self.needs_bang();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue