diff options
author | Kirill Bulatov <[email protected]> | 2020-11-27 16:00:03 +0000 |
---|---|---|
committer | Kirill Bulatov <[email protected]> | 2020-11-27 16:00:03 +0000 |
commit | b2e6ca46ca2ad3352ef13154b401e798e9a7d752 (patch) | |
tree | a58af78b157d815799c5c3f0a9c30470eb7a751a /crates/completion/src | |
parent | c66d477f5a72247b04b9025f6ba9c403ca628d41 (diff) |
Profile completions better
Diffstat (limited to 'crates/completion/src')
-rw-r--r-- | crates/completion/src/item.rs | 2 | ||||
-rw-r--r-- | crates/completion/src/render/enum_variant.rs | 1 | ||||
-rw-r--r-- | crates/completion/src/render/function.rs | 1 | ||||
-rw-r--r-- | crates/completion/src/render/macro_.rs | 1 |
4 files changed, 5 insertions, 0 deletions
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 { | |||
278 | 278 | ||
279 | impl Builder { | 279 | impl Builder { |
280 | pub(crate) fn build(self) -> CompletionItem { | 280 | pub(crate) fn build(self) -> CompletionItem { |
281 | let _p = profile::span("item::Builder::build"); | ||
282 | |||
281 | let mut label = self.label; | 283 | let mut label = self.label; |
282 | let mut lookup = self.lookup; | 284 | let mut lookup = self.lookup; |
283 | let mut insert_text = self.insert_text; | 285 | 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>( | |||
17 | variant: hir::EnumVariant, | 17 | variant: hir::EnumVariant, |
18 | path: Option<ModPath>, | 18 | path: Option<ModPath>, |
19 | ) -> CompletionItem { | 19 | ) -> CompletionItem { |
20 | let _p = profile::span("render_enum_variant"); | ||
20 | EnumVariantRender::new(ctx, local_name, variant, path).render(import_data) | 21 | EnumVariantRender::new(ctx, local_name, variant, path).render(import_data) |
21 | } | 22 | } |
22 | 23 | ||
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>( | |||
15 | local_name: Option<String>, | 15 | local_name: Option<String>, |
16 | fn_: hir::Function, | 16 | fn_: hir::Function, |
17 | ) -> CompletionItem { | 17 | ) -> CompletionItem { |
18 | let _p = profile::span("render_fn"); | ||
18 | FunctionRender::new(ctx, local_name, fn_).render(import_data) | 19 | FunctionRender::new(ctx, local_name, fn_).render(import_data) |
19 | } | 20 | } |
20 | 21 | ||
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>( | |||
16 | name: String, | 16 | name: String, |
17 | macro_: hir::MacroDef, | 17 | macro_: hir::MacroDef, |
18 | ) -> Option<CompletionItem> { | 18 | ) -> Option<CompletionItem> { |
19 | let _p = profile::span("render_macro"); | ||
19 | MacroRender::new(ctx, name, macro_).render(import_data) | 20 | MacroRender::new(ctx, name, macro_).render(import_data) |
20 | } | 21 | } |
21 | 22 | ||