Source map returns a result

cc #2236
This commit is contained in:
Aleksey Kladov 2020-03-06 14:44:44 +01:00
parent ea0c124219
commit fb5891c433
6 changed files with 26 additions and 18 deletions

View file

@ -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;