From b2e6ca46ca2ad3352ef13154b401e798e9a7d752 Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Fri, 27 Nov 2020 18:00:03 +0200 Subject: Profile completions better --- crates/completion/src/item.rs | 2 ++ crates/completion/src/render/enum_variant.rs | 1 + crates/completion/src/render/function.rs | 1 + crates/completion/src/render/macro_.rs | 1 + 4 files changed, 5 insertions(+) (limited to 'crates/completion') diff --git a/crates/completion/src/item.rs b/crates/completion/src/item.rs index b13c3f376..7b62c2c4e 100644 --- a/crates/completion/src/item.rs +++ b/crates/completion/src/item.rs @@ -278,6 +278,8 @@ pub(crate) struct Builder { impl Builder { pub(crate) fn build(self) -> CompletionItem { + let _p = profile::span("item::Builder::build"); + let mut label = self.label; let mut lookup = self.lookup; let mut insert_text = self.insert_text; diff --git a/crates/completion/src/render/enum_variant.rs b/crates/completion/src/render/enum_variant.rs index 6070e9b1d..64e742b77 100644 --- a/crates/completion/src/render/enum_variant.rs +++ b/crates/completion/src/render/enum_variant.rs @@ -17,6 +17,7 @@ pub(crate) fn render_enum_variant<'a>( variant: hir::EnumVariant, path: Option, ) -> CompletionItem { + let _p = profile::span("render_enum_variant"); EnumVariantRender::new(ctx, local_name, variant, path).render(import_data) } diff --git a/crates/completion/src/render/function.rs b/crates/completion/src/render/function.rs index 9dd5cd18c..e8b726ad6 100644 --- a/crates/completion/src/render/function.rs +++ b/crates/completion/src/render/function.rs @@ -15,6 +15,7 @@ pub(crate) fn render_fn<'a>( local_name: Option, fn_: hir::Function, ) -> CompletionItem { + let _p = profile::span("render_fn"); FunctionRender::new(ctx, local_name, fn_).render(import_data) } diff --git a/crates/completion/src/render/macro_.rs b/crates/completion/src/render/macro_.rs index fead59e41..91055a296 100644 --- a/crates/completion/src/render/macro_.rs +++ b/crates/completion/src/render/macro_.rs @@ -16,6 +16,7 @@ pub(crate) fn render_macro<'a>( name: String, macro_: hir::MacroDef, ) -> Option { + let _p = profile::span("render_macro"); MacroRender::new(ctx, name, macro_).render(import_data) } -- cgit v1.2.3