From fb5891c4330e577f5d6891be529141695ce36d4f Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 6 Mar 2020 14:44:44 +0100 Subject: Source map returns a result cc #2236 --- crates/ra_hir/src/source_analyzer.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/ra_hir/src') diff --git a/crates/ra_hir/src/source_analyzer.rs b/crates/ra_hir/src/source_analyzer.rs index f3f1ed05a..331ecdd9c 100644 --- a/crates/ra_hir/src/source_analyzer.rs +++ b/crates/ra_hir/src/source_analyzer.rs @@ -261,7 +261,7 @@ fn scope_for_offset( .scope_by_expr() .iter() .filter_map(|(id, scope)| { - let source = source_map.expr_syntax(*id)?; + let source = source_map.expr_syntax(*id).ok()?; // FIXME: correctly handle macro expansion if source.file_id != offset.file_id { return None; @@ -337,7 +337,7 @@ fn adjust( .scope_by_expr() .iter() .filter_map(|(id, scope)| { - let source = source_map.expr_syntax(*id)?; + let source = source_map.expr_syntax(*id).ok()?; // FIXME: correctly handle macro expansion if source.file_id != file_id { return None; -- cgit v1.2.3