diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-04-14 23:21:12 +0100 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-04-14 23:21:12 +0100 |
commit | 546d9be2a7bf7b3942c125f922a01321aea6ad26 (patch) | |
tree | 7323905a2e0efe7fefb029c8d049987df6a6462f /crates/ra_lsp_server/src/main_loop/handlers.rs | |
parent | e1a2649aff0a9387fb14646a56cb652061bc42ec (diff) | |
parent | 247ac265f1e7f2d812e6f9174d48ceef45465b91 (diff) |
Merge #1146
1146: Moar profiling r=matklad a=matklad
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_lsp_server/src/main_loop/handlers.rs')
-rw-r--r-- | crates/ra_lsp_server/src/main_loop/handlers.rs | 3 |
1 files changed, 3 insertions, 0 deletions
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::{ | |||
12 | AssistId, | 12 | AssistId, |
13 | }; | 13 | }; |
14 | use ra_syntax::{AstNode, SyntaxKind, TextUnit}; | 14 | use ra_syntax::{AstNode, SyntaxKind, TextUnit}; |
15 | use ra_prof::profile; | ||
15 | use rustc_hash::FxHashMap; | 16 | use rustc_hash::FxHashMap; |
16 | use serde::{Serialize, Deserialize}; | 17 | use serde::{Serialize, Deserialize}; |
17 | use serde_json::to_value; | 18 | use serde_json::to_value; |
@@ -328,6 +329,7 @@ pub fn handle_completion( | |||
328 | world: ServerWorld, | 329 | world: ServerWorld, |
329 | params: req::CompletionParams, | 330 | params: req::CompletionParams, |
330 | ) -> Result<Option<req::CompletionResponse>> { | 331 | ) -> Result<Option<req::CompletionResponse>> { |
332 | let _p = profile("handle_completion"); | ||
331 | let position = { | 333 | let position = { |
332 | let file_id = params.text_document.try_conv_with(&world)?; | 334 | let file_id = params.text_document.try_conv_with(&world)?; |
333 | let line_index = world.analysis().file_line_index(file_id); | 335 | let line_index = world.analysis().file_line_index(file_id); |
@@ -564,6 +566,7 @@ pub fn handle_code_action( | |||
564 | world: ServerWorld, | 566 | world: ServerWorld, |
565 | params: req::CodeActionParams, | 567 | params: req::CodeActionParams, |
566 | ) -> Result<Option<CodeActionResponse>> { | 568 | ) -> Result<Option<CodeActionResponse>> { |
569 | let _p = profile("handle_code_action"); | ||
567 | let file_id = params.text_document.try_conv_with(&world)?; | 570 | let file_id = params.text_document.try_conv_with(&world)?; |
568 | let line_index = world.analysis().file_line_index(file_id); | 571 | let line_index = world.analysis().file_line_index(file_id); |
569 | let range = params.range.conv_with(&line_index); | 572 | let range = params.range.conv_with(&line_index); |