From 11f3c8afb23d67acde8cc7642aea3a2ca06a2361 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 15 Jan 2019 18:13:11 +0300 Subject: remove Cancelable from source binders --- crates/ra_ide_api/src/goto_definition.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'crates/ra_ide_api/src/goto_definition.rs') diff --git a/crates/ra_ide_api/src/goto_definition.rs b/crates/ra_ide_api/src/goto_definition.rs index 332a2fb8d..f759f7339 100644 --- a/crates/ra_ide_api/src/goto_definition.rs +++ b/crates/ra_ide_api/src/goto_definition.rs @@ -48,7 +48,7 @@ pub(crate) fn reference_definition( ) -> Cancelable { use self::ReferenceResult::*; if let Some(function) = - hir::source_binder::function_from_child_node(db, file_id, name_ref.syntax())? + hir::source_binder::function_from_child_node(db, file_id, name_ref.syntax()) { let scope = function.scopes(db)?; // First try to resolve the symbol locally @@ -77,8 +77,7 @@ pub(crate) fn reference_definition( } } // Then try module name resolution - if let Some(module) = - hir::source_binder::module_from_child_node(db, file_id, name_ref.syntax())? + if let Some(module) = hir::source_binder::module_from_child_node(db, file_id, name_ref.syntax()) { if let Some(path) = name_ref .syntax() @@ -111,7 +110,7 @@ fn name_definition( if let Some(module) = name.syntax().parent().and_then(ast::Module::cast) { if module.has_semi() { if let Some(child_module) = - hir::source_binder::module_from_declaration(db, file_id, module)? + hir::source_binder::module_from_declaration(db, file_id, module) { let nav = NavigationTarget::from_module(db, child_module)?; return Ok(Some(vec![nav])); -- cgit v1.2.3 From fb012e5c1e49af73b480127bcf56d8f5993b8032 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 15 Jan 2019 18:19:09 +0300 Subject: remove cancelable from symbols --- crates/ra_ide_api/src/goto_definition.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/ra_ide_api/src/goto_definition.rs') diff --git a/crates/ra_ide_api/src/goto_definition.rs b/crates/ra_ide_api/src/goto_definition.rs index f759f7339..591f36cce 100644 --- a/crates/ra_ide_api/src/goto_definition.rs +++ b/crates/ra_ide_api/src/goto_definition.rs @@ -95,7 +95,7 @@ pub(crate) fn reference_definition( } // If that fails try the index based approach. let navs = db - .index_resolve(name_ref)? + .index_resolve(name_ref) .into_iter() .map(NavigationTarget::from_symbol) .collect(); -- cgit v1.2.3