remove Cancelable from source binders

This commit is contained in:
Aleksey Kladov 2019-01-15 18:13:11 +03:00
parent a36b2cf377
commit 11f3c8afb2
16 changed files with 68 additions and 90 deletions

View file

@ -48,7 +48,7 @@ pub(crate) fn reference_definition(
) -> Cancelable<ReferenceResult> {
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]));