From c4a5aa45dc480792b24535ee6739a4e9a15e8aa8 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sun, 14 Apr 2019 23:28:10 +0300 Subject: add a couple of profiling points --- crates/ra_lsp_server/src/main_loop/handlers.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'crates/ra_lsp_server/src/main_loop') diff --git a/crates/ra_lsp_server/src/main_loop/handlers.rs b/crates/ra_lsp_server/src/main_loop/handlers.rs index 41d1f759f..eb8a53545 100644 --- a/crates/ra_lsp_server/src/main_loop/handlers.rs +++ b/crates/ra_lsp_server/src/main_loop/handlers.rs @@ -12,6 +12,7 @@ use ra_ide_api::{ AssistId, }; use ra_syntax::{AstNode, SyntaxKind, TextUnit}; +use ra_prof::profile; use rustc_hash::FxHashMap; use serde::{Serialize, Deserialize}; use serde_json::to_value; @@ -328,6 +329,7 @@ pub fn handle_completion( world: ServerWorld, params: req::CompletionParams, ) -> Result> { + let _p = profile("handle_completion"); let position = { let file_id = params.text_document.try_conv_with(&world)?; let line_index = world.analysis().file_line_index(file_id); @@ -564,6 +566,7 @@ pub fn handle_code_action( world: ServerWorld, params: req::CodeActionParams, ) -> Result> { + let _p = profile("handle_code_action"); let file_id = params.text_document.try_conv_with(&world)?; let line_index = world.analysis().file_line_index(file_id); let range = params.range.conv_with(&line_index); -- cgit v1.2.3