diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-10-23 16:44:40 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2019-10-23 16:44:40 +0100 |
commit | edf4d8e555c6847fb9e6e61d727c4def11789bfc (patch) | |
tree | 873f149757109f1409f30be535d1d5d7afe7d6c6 /crates/ra_lsp_server/src/main_loop | |
parent | a2df005e082666587a8d9c206fc9f64208e19fbd (diff) | |
parent | f5bf7f29b58d0ae93a87d41b3d893a64c8b66bf3 (diff) |
Merge #2049
2049: add couple of profiling calls r=matklad a=matklad
bors r+
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_lsp_server/src/main_loop')
-rw-r--r-- | crates/ra_lsp_server/src/main_loop/handlers.rs | 4 |
1 files changed, 4 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 307082865..e65f075a6 100644 --- a/crates/ra_lsp_server/src/main_loop/handlers.rs +++ b/crates/ra_lsp_server/src/main_loop/handlers.rs | |||
@@ -438,6 +438,7 @@ pub fn handle_prepare_rename( | |||
438 | world: WorldSnapshot, | 438 | world: WorldSnapshot, |
439 | params: req::TextDocumentPositionParams, | 439 | params: req::TextDocumentPositionParams, |
440 | ) -> Result<Option<PrepareRenameResponse>> { | 440 | ) -> Result<Option<PrepareRenameResponse>> { |
441 | let _p = profile("handle_prepare_rename"); | ||
441 | let position = params.try_conv_with(&world)?; | 442 | let position = params.try_conv_with(&world)?; |
442 | 443 | ||
443 | // We support renaming references like handle_rename does. | 444 | // We support renaming references like handle_rename does. |
@@ -455,6 +456,7 @@ pub fn handle_prepare_rename( | |||
455 | } | 456 | } |
456 | 457 | ||
457 | pub fn handle_rename(world: WorldSnapshot, params: RenameParams) -> Result<Option<WorkspaceEdit>> { | 458 | pub fn handle_rename(world: WorldSnapshot, params: RenameParams) -> Result<Option<WorkspaceEdit>> { |
459 | let _p = profile("handle_rename"); | ||
458 | let position = params.text_document_position.try_conv_with(&world)?; | 460 | let position = params.text_document_position.try_conv_with(&world)?; |
459 | 461 | ||
460 | if params.new_name.is_empty() { | 462 | if params.new_name.is_empty() { |
@@ -480,6 +482,7 @@ pub fn handle_references( | |||
480 | world: WorldSnapshot, | 482 | world: WorldSnapshot, |
481 | params: req::ReferenceParams, | 483 | params: req::ReferenceParams, |
482 | ) -> Result<Option<Vec<Location>>> { | 484 | ) -> Result<Option<Vec<Location>>> { |
485 | let _p = profile("handle_references"); | ||
483 | let position = params.text_document_position.try_conv_with(&world)?; | 486 | let position = params.text_document_position.try_conv_with(&world)?; |
484 | 487 | ||
485 | let refs = match world.analysis().find_all_refs(position)? { | 488 | let refs = match world.analysis().find_all_refs(position)? { |
@@ -741,6 +744,7 @@ pub fn handle_document_highlight( | |||
741 | world: WorldSnapshot, | 744 | world: WorldSnapshot, |
742 | params: req::TextDocumentPositionParams, | 745 | params: req::TextDocumentPositionParams, |
743 | ) -> Result<Option<Vec<DocumentHighlight>>> { | 746 | ) -> Result<Option<Vec<DocumentHighlight>>> { |
747 | let _p = profile("handle_document_highlight"); | ||
744 | let file_id = params.text_document.try_conv_with(&world)?; | 748 | let file_id = params.text_document.try_conv_with(&world)?; |
745 | let line_index = world.analysis().file_line_index(file_id)?; | 749 | let line_index = world.analysis().file_line_index(file_id)?; |
746 | 750 | ||