Various small fixes

This commit is contained in:
Lukas Wirth 2023-09-22 08:08:00 +02:00
parent e63e323823
commit 556f0c6704
6 changed files with 22 additions and 20 deletions

View file

@ -888,7 +888,7 @@ fn scope_for_offset(
.scope_by_expr()
.iter()
.filter_map(|(id, scope)| {
let InFile { file_id, value } = source_map.expr_syntax(*id).ok()?;
let InFile { file_id, value } = source_map.expr_syntax(id).ok()?;
if from_file == file_id {
return Some((value.text_range(), scope));
}
@ -923,7 +923,7 @@ fn adjust(
.scope_by_expr()
.iter()
.filter_map(|(id, scope)| {
let source = source_map.expr_syntax(*id).ok()?;
let source = source_map.expr_syntax(id).ok()?;
// FIXME: correctly handle macro expansion
if source.file_id != from_file {
return None;