From 50e06ee95ab12bc204fdce557ab0fb7aa5e5ab2f Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Thu, 3 Dec 2020 00:13:32 +0200 Subject: Refactor the code --- crates/completion/src/render/enum_variant.rs | 5 ++++- crates/completion/src/render/function.rs | 5 ++++- crates/completion/src/render/macro_.rs | 5 ++++- 3 files changed, 12 insertions(+), 3 deletions(-) (limited to 'crates/completion/src/render') 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> { .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 { 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> { .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() } 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> { .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(); -- cgit v1.2.3