2049: add couple of profiling calls r=matklad a=matklad

bors r+

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
This commit is contained in:
bors[bot] 2019-10-23 15:44:40 +00:00 committed by GitHub
commit edf4d8e555
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -438,6 +438,7 @@ pub fn handle_prepare_rename(
world: WorldSnapshot,
params: req::TextDocumentPositionParams,
) -> Result<Option<PrepareRenameResponse>> {
let _p = profile("handle_prepare_rename");
let position = params.try_conv_with(&world)?;
// We support renaming references like handle_rename does.
@ -455,6 +456,7 @@ pub fn handle_prepare_rename(
}
pub fn handle_rename(world: WorldSnapshot, params: RenameParams) -> Result<Option<WorkspaceEdit>> {
let _p = profile("handle_rename");
let position = params.text_document_position.try_conv_with(&world)?;
if params.new_name.is_empty() {
@ -480,6 +482,7 @@ pub fn handle_references(
world: WorldSnapshot,
params: req::ReferenceParams,
) -> Result<Option<Vec<Location>>> {
let _p = profile("handle_references");
let position = params.text_document_position.try_conv_with(&world)?;
let refs = match world.analysis().find_all_refs(position)? {
@ -741,6 +744,7 @@ pub fn handle_document_highlight(
world: WorldSnapshot,
params: req::TextDocumentPositionParams,
) -> Result<Option<Vec<DocumentHighlight>>> {
let _p = profile("handle_document_highlight");
let file_id = params.text_document.try_conv_with(&world)?;
let line_index = world.analysis().file_line_index(file_id)?;