From 9fb41716de095fa365eecedab3427af7b5001644 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sat, 20 Oct 2018 22:09:12 +0300 Subject: make more things cancelable --- crates/ra_lsp_server/src/main_loop/handlers.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'crates/ra_lsp_server') 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( query: Query, ) -> Result> { let mut res = Vec::new(); - for (file_id, symbol) in world.analysis().symbol_search(query) { + for (file_id, symbol) in world.analysis().symbol_search(query)? { let line_index = world.analysis().file_line_index(file_id); let info = SymbolInformation { name: symbol.name.to_string(), @@ -221,7 +221,7 @@ pub fn handle_goto_definition( let mut res = Vec::new(); for (file_id, symbol) in world .analysis() - .approximately_resolve_symbol(file_id, offset) + .approximately_resolve_symbol(file_id, offset)? { let line_index = world.analysis().file_line_index(file_id); let location = to_location(file_id, symbol.node_range, &world, &line_index)?; @@ -435,7 +435,7 @@ pub fn handle_signature_help( let offset = params.position.conv_with(&line_index); if let Some((descriptor, active_param)) = - world.analysis().resolve_callable(file_id, offset) + world.analysis().resolve_callable(file_id, offset)? { let parameters: Vec = descriptor .params @@ -473,7 +473,7 @@ pub fn handle_prepare_rename( // We support renaming references like handle_rename does. // In the future we may want to reject the renaming of things like keywords here too. - let refs = world.analysis().find_all_refs(file_id, offset); + let refs = world.analysis().find_all_refs(file_id, offset)?; if refs.is_empty() { return Ok(None); } @@ -497,7 +497,7 @@ pub fn handle_rename( return Ok(None); } - let refs = world.analysis().find_all_refs(file_id, offset); + let refs = world.analysis().find_all_refs(file_id, offset)?; if refs.is_empty() { return Ok(None); } @@ -530,7 +530,7 @@ pub fn handle_references( let line_index = world.analysis().file_line_index(file_id); let offset = params.position.conv_with(&line_index); - let refs = world.analysis().find_all_refs(file_id, offset); + let refs = world.analysis().find_all_refs(file_id, offset)?; Ok(Some(refs.into_iter() .filter_map(|r| to_location(r.0, r.1, &world, &line_index).ok()) -- cgit v1.2.3