aboutsummaryrefslogtreecommitdiff
path: root/crates/completion/src/render
diff options
context:
space:
mode:
authorKirill Bulatov <[email protected]>2020-12-02 22:13:32 +0000
committerKirill Bulatov <[email protected]>2020-12-07 21:41:08 +0000
commit50e06ee95ab12bc204fdce557ab0fb7aa5e5ab2f (patch)
tree84288818104bab46ac52a60e6e0d4ba4624ab817 /crates/completion/src/render
parentd9bd1f171dde11ff04f0619b14d8f25e5e4fc56e (diff)
Refactor the code
Diffstat (limited to 'crates/completion/src/render')
-rw-r--r--crates/completion/src/render/enum_variant.rs5
-rw-r--r--crates/completion/src/render/function.rs5
-rw-r--r--crates/completion/src/render/macro_.rs5
3 files changed, 12 insertions, 3 deletions
diff --git a/crates/completion/src/render/enum_variant.rs b/crates/completion/src/render/enum_variant.rs
index c08824c6a..6548b4676 100644
--- a/crates/completion/src/render/enum_variant.rs
+++ b/crates/completion/src/render/enum_variant.rs
@@ -71,7 +71,10 @@ impl<'a> EnumVariantRender<'a> {
71 .kind(CompletionItemKind::EnumVariant) 71 .kind(CompletionItemKind::EnumVariant)
72 .set_documentation(self.variant.docs(self.ctx.db())) 72 .set_documentation(self.variant.docs(self.ctx.db()))
73 .set_deprecated(self.ctx.is_deprecated(self.variant)) 73 .set_deprecated(self.ctx.is_deprecated(self.variant))
74 .add_import(import_to_add, self.ctx.completion.config.should_resolve_immediately()) 74 .add_import(
75 import_to_add,
76 self.ctx.completion.config.should_resolve_additional_edits_immediately(),
77 )
75 .detail(self.detail()); 78 .detail(self.detail());
76 79
77 if self.variant_kind == StructKind::Tuple { 80 if self.variant_kind == StructKind::Tuple {
diff --git a/crates/completion/src/render/function.rs b/crates/completion/src/render/function.rs
index 3492384c6..b13e0dafc 100644
--- a/crates/completion/src/render/function.rs
+++ b/crates/completion/src/render/function.rs
@@ -47,7 +47,10 @@ impl<'a> FunctionRender<'a> {
47 .set_deprecated(self.ctx.is_deprecated(self.func)) 47 .set_deprecated(self.ctx.is_deprecated(self.func))
48 .detail(self.detail()) 48 .detail(self.detail())
49 .add_call_parens(self.ctx.completion, self.name, params) 49 .add_call_parens(self.ctx.completion, self.name, params)
50 .add_import(import_to_add, self.ctx.completion.config.should_resolve_immediately()) 50 .add_import(
51 import_to_add,
52 self.ctx.completion.config.should_resolve_additional_edits_immediately(),
53 )
51 .build() 54 .build()
52 } 55 }
53 56
diff --git a/crates/completion/src/render/macro_.rs b/crates/completion/src/render/macro_.rs
index 15648b5b7..7a8eeb7b9 100644
--- a/crates/completion/src/render/macro_.rs
+++ b/crates/completion/src/render/macro_.rs
@@ -50,7 +50,10 @@ impl<'a> MacroRender<'a> {
50 .kind(CompletionItemKind::Macro) 50 .kind(CompletionItemKind::Macro)
51 .set_documentation(self.docs.clone()) 51 .set_documentation(self.docs.clone())
52 .set_deprecated(self.ctx.is_deprecated(self.macro_)) 52 .set_deprecated(self.ctx.is_deprecated(self.macro_))
53 .add_import(import_to_add, self.ctx.completion.config.should_resolve_immediately()) 53 .add_import(
54 import_to_add,
55 self.ctx.completion.config.should_resolve_additional_edits_immediately(),
56 )
54 .detail(self.detail()); 57 .detail(self.detail());
55 58
56 let needs_bang = self.needs_bang(); 59 let needs_bang = self.needs_bang();