mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-11-10 15:14:32 +00:00
Merge #1333
1333: add profile calls to real-time requests r=matklad a=matklad Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
This commit is contained in:
commit
4b48cff022
1 changed files with 5 additions and 0 deletions
|
@ -64,6 +64,7 @@ pub fn handle_selection_range(
|
|||
world: ServerWorld,
|
||||
params: req::SelectionRangeParams,
|
||||
) -> Result<Vec<req::SelectionRange>> {
|
||||
let _p = profile("handle_selection_range");
|
||||
let file_id = params.text_document.try_conv_with(&world)?;
|
||||
let line_index = world.analysis().file_line_index(file_id);
|
||||
params
|
||||
|
@ -104,6 +105,7 @@ pub fn handle_find_matching_brace(
|
|||
world: ServerWorld,
|
||||
params: req::FindMatchingBraceParams,
|
||||
) -> Result<Vec<Position>> {
|
||||
let _p = profile("handle_find_matching_brace");
|
||||
let file_id = params.text_document.try_conv_with(&world)?;
|
||||
let line_index = world.analysis().file_line_index(file_id);
|
||||
let res = params
|
||||
|
@ -122,6 +124,7 @@ pub fn handle_join_lines(
|
|||
world: ServerWorld,
|
||||
params: req::JoinLinesParams,
|
||||
) -> Result<req::SourceChange> {
|
||||
let _p = profile("handle_join_lines");
|
||||
let frange = (¶ms.text_document, params.range).try_conv_with(&world)?;
|
||||
world.analysis().join_lines(frange).try_conv_with(&world)
|
||||
}
|
||||
|
@ -130,6 +133,7 @@ pub fn handle_on_enter(
|
|||
world: ServerWorld,
|
||||
params: req::TextDocumentPositionParams,
|
||||
) -> Result<Option<req::SourceChange>> {
|
||||
let _p = profile("handle_on_enter");
|
||||
let position = params.try_conv_with(&world)?;
|
||||
match world.analysis().on_enter(position) {
|
||||
None => Ok(None),
|
||||
|
@ -141,6 +145,7 @@ pub fn handle_on_type_formatting(
|
|||
world: ServerWorld,
|
||||
params: req::DocumentOnTypeFormattingParams,
|
||||
) -> Result<Option<Vec<TextEdit>>> {
|
||||
let _p = profile("handle_on_type_formatting");
|
||||
let file_id = params.text_document.try_conv_with(&world)?;
|
||||
let line_index = world.analysis().file_line_index(file_id);
|
||||
let position = FilePosition {
|
||||
|
|
Loading…
Reference in a new issue