aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-03-06 13:44:44 +0000
committerAleksey Kladov <[email protected]>2020-03-06 13:44:44 +0000
commitfb5891c4330e577f5d6891be529141695ce36d4f (patch)
tree6c7f1384e77c29b9bdc3080acfbaadb1bcb01f0f /crates/ra_hir/src
parentea0c124219da33462b9d0be93f7abe0478cc7af2 (diff)
Source map returns a result
cc #2236
Diffstat (limited to 'crates/ra_hir/src')
-rw-r--r--crates/ra_hir/src/source_analyzer.rs4
1 files changed, 2 insertions, 2 deletions
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(
261 .scope_by_expr() 261 .scope_by_expr()
262 .iter() 262 .iter()
263 .filter_map(|(id, scope)| { 263 .filter_map(|(id, scope)| {
264 let source = source_map.expr_syntax(*id)?; 264 let source = source_map.expr_syntax(*id).ok()?;
265 // FIXME: correctly handle macro expansion 265 // FIXME: correctly handle macro expansion
266 if source.file_id != offset.file_id { 266 if source.file_id != offset.file_id {
267 return None; 267 return None;
@@ -337,7 +337,7 @@ fn adjust(
337 .scope_by_expr() 337 .scope_by_expr()
338 .iter() 338 .iter()
339 .filter_map(|(id, scope)| { 339 .filter_map(|(id, scope)| {
340 let source = source_map.expr_syntax(*id)?; 340 let source = source_map.expr_syntax(*id).ok()?;
341 // FIXME: correctly handle macro expansion 341 // FIXME: correctly handle macro expansion
342 if source.file_id != file_id { 342 if source.file_id != file_id {
343 return None; 343 return None;