diff options
author | Aleksey Kladov <[email protected]> | 2018-10-20 20:09:12 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-10-20 20:09:12 +0100 |
commit | 9fb41716de095fa365eecedab3427af7b5001644 (patch) | |
tree | 05b2d6bc6e02e493f39509a9c46d36564aef270b /crates/ra_lsp_server | |
parent | 998f2ae7627053a9363a05a1ab79359882dce39f (diff) |
make more things cancelable
Diffstat (limited to 'crates/ra_lsp_server')
-rw-r--r-- | crates/ra_lsp_server/src/main_loop/handlers.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/crates/ra_lsp_server/src/main_loop/handlers.rs b/crates/ra_lsp_server/src/main_loop/handlers.rs index 9e76a51c1..78a8ccfc5 100644 --- a/crates/ra_lsp_server/src/main_loop/handlers.rs +++ b/crates/ra_lsp_server/src/main_loop/handlers.rs | |||
@@ -195,7 +195,7 @@ pub fn handle_workspace_symbol( | |||
195 | query: Query, | 195 | query: Query, |
196 | ) -> Result<Vec<SymbolInformation>> { | 196 | ) -> Result<Vec<SymbolInformation>> { |
197 | let mut res = Vec::new(); | 197 | let mut res = Vec::new(); |
198 | for (file_id, symbol) in world.analysis().symbol_search(query) { | 198 | for (file_id, symbol) in world.analysis().symbol_search(query)? { |
199 | let line_index = world.analysis().file_line_index(file_id); | 199 | let line_index = world.analysis().file_line_index(file_id); |
200 | let info = SymbolInformation { | 200 | let info = SymbolInformation { |
201 | name: symbol.name.to_string(), | 201 | name: symbol.name.to_string(), |
@@ -221,7 +221,7 @@ pub fn handle_goto_definition( | |||
221 | let mut res = Vec::new(); | 221 | let mut res = Vec::new(); |
222 | for (file_id, symbol) in world | 222 | for (file_id, symbol) in world |
223 | .analysis() | 223 | .analysis() |
224 | .approximately_resolve_symbol(file_id, offset) | 224 | .approximately_resolve_symbol(file_id, offset)? |
225 | { | 225 | { |
226 | let line_index = world.analysis().file_line_index(file_id); | 226 | let line_index = world.analysis().file_line_index(file_id); |
227 | let location = to_location(file_id, symbol.node_range, &world, &line_index)?; | 227 | let location = to_location(file_id, symbol.node_range, &world, &line_index)?; |
@@ -435,7 +435,7 @@ pub fn handle_signature_help( | |||
435 | let offset = params.position.conv_with(&line_index); | 435 | let offset = params.position.conv_with(&line_index); |
436 | 436 | ||
437 | if let Some((descriptor, active_param)) = | 437 | if let Some((descriptor, active_param)) = |
438 | world.analysis().resolve_callable(file_id, offset) | 438 | world.analysis().resolve_callable(file_id, offset)? |
439 | { | 439 | { |
440 | let parameters: Vec<ParameterInformation> = descriptor | 440 | let parameters: Vec<ParameterInformation> = descriptor |
441 | .params | 441 | .params |
@@ -473,7 +473,7 @@ pub fn handle_prepare_rename( | |||
473 | 473 | ||
474 | // We support renaming references like handle_rename does. | 474 | // We support renaming references like handle_rename does. |
475 | // In the future we may want to reject the renaming of things like keywords here too. | 475 | // In the future we may want to reject the renaming of things like keywords here too. |
476 | let refs = world.analysis().find_all_refs(file_id, offset); | 476 | let refs = world.analysis().find_all_refs(file_id, offset)?; |
477 | if refs.is_empty() { | 477 | if refs.is_empty() { |
478 | return Ok(None); | 478 | return Ok(None); |
479 | } | 479 | } |
@@ -497,7 +497,7 @@ pub fn handle_rename( | |||
497 | return Ok(None); | 497 | return Ok(None); |
498 | } | 498 | } |
499 | 499 | ||
500 | let refs = world.analysis().find_all_refs(file_id, offset); | 500 | let refs = world.analysis().find_all_refs(file_id, offset)?; |
501 | if refs.is_empty() { | 501 | if refs.is_empty() { |
502 | return Ok(None); | 502 | return Ok(None); |
503 | } | 503 | } |
@@ -530,7 +530,7 @@ pub fn handle_references( | |||
530 | let line_index = world.analysis().file_line_index(file_id); | 530 | let line_index = world.analysis().file_line_index(file_id); |
531 | let offset = params.position.conv_with(&line_index); | 531 | let offset = params.position.conv_with(&line_index); |
532 | 532 | ||
533 | let refs = world.analysis().find_all_refs(file_id, offset); | 533 | let refs = world.analysis().find_all_refs(file_id, offset)?; |
534 | 534 | ||
535 | Ok(Some(refs.into_iter() | 535 | Ok(Some(refs.into_iter() |
536 | .filter_map(|r| to_location(r.0, r.1, &world, &line_index).ok()) | 536 | .filter_map(|r| to_location(r.0, r.1, &world, &line_index).ok()) |