aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_lsp_server/src/main_loop
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_lsp_server/src/main_loop')
-rw-r--r--crates/ra_lsp_server/src/main_loop/handlers.rs5
1 files changed, 5 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 23802e5e1..a82ae696b 100644
--- a/crates/ra_lsp_server/src/main_loop/handlers.rs
+++ b/crates/ra_lsp_server/src/main_loop/handlers.rs
@@ -64,6 +64,7 @@ pub fn handle_selection_range(
64 world: ServerWorld, 64 world: ServerWorld,
65 params: req::SelectionRangeParams, 65 params: req::SelectionRangeParams,
66) -> Result<Vec<req::SelectionRange>> { 66) -> Result<Vec<req::SelectionRange>> {
67 let _p = profile("handle_selection_range");
67 let file_id = params.text_document.try_conv_with(&world)?; 68 let file_id = params.text_document.try_conv_with(&world)?;
68 let line_index = world.analysis().file_line_index(file_id); 69 let line_index = world.analysis().file_line_index(file_id);
69 params 70 params
@@ -104,6 +105,7 @@ pub fn handle_find_matching_brace(
104 world: ServerWorld, 105 world: ServerWorld,
105 params: req::FindMatchingBraceParams, 106 params: req::FindMatchingBraceParams,
106) -> Result<Vec<Position>> { 107) -> Result<Vec<Position>> {
108 let _p = profile("handle_find_matching_brace");
107 let file_id = params.text_document.try_conv_with(&world)?; 109 let file_id = params.text_document.try_conv_with(&world)?;
108 let line_index = world.analysis().file_line_index(file_id); 110 let line_index = world.analysis().file_line_index(file_id);
109 let res = params 111 let res = params
@@ -122,6 +124,7 @@ pub fn handle_join_lines(
122 world: ServerWorld, 124 world: ServerWorld,
123 params: req::JoinLinesParams, 125 params: req::JoinLinesParams,
124) -> Result<req::SourceChange> { 126) -> Result<req::SourceChange> {
127 let _p = profile("handle_join_lines");
125 let frange = (&params.text_document, params.range).try_conv_with(&world)?; 128 let frange = (&params.text_document, params.range).try_conv_with(&world)?;
126 world.analysis().join_lines(frange).try_conv_with(&world) 129 world.analysis().join_lines(frange).try_conv_with(&world)
127} 130}
@@ -130,6 +133,7 @@ pub fn handle_on_enter(
130 world: ServerWorld, 133 world: ServerWorld,
131 params: req::TextDocumentPositionParams, 134 params: req::TextDocumentPositionParams,
132) -> Result<Option<req::SourceChange>> { 135) -> Result<Option<req::SourceChange>> {
136 let _p = profile("handle_on_enter");
133 let position = params.try_conv_with(&world)?; 137 let position = params.try_conv_with(&world)?;
134 match world.analysis().on_enter(position) { 138 match world.analysis().on_enter(position) {
135 None => Ok(None), 139 None => Ok(None),
@@ -141,6 +145,7 @@ pub fn handle_on_type_formatting(
141 world: ServerWorld, 145 world: ServerWorld,
142 params: req::DocumentOnTypeFormattingParams, 146 params: req::DocumentOnTypeFormattingParams,
143) -> Result<Option<Vec<TextEdit>>> { 147) -> Result<Option<Vec<TextEdit>>> {
148 let _p = profile("handle_on_type_formatting");
144 let file_id = params.text_document.try_conv_with(&world)?; 149 let file_id = params.text_document.try_conv_with(&world)?;
145 let line_index = world.analysis().file_line_index(file_id); 150 let line_index = world.analysis().file_line_index(file_id);
146 let position = FilePosition { 151 let position = FilePosition {