Skip to content

Commit

Permalink
Auto merge of rust-lang#17347 - Veykril:inv-offset-err, r=Veykril
Browse files Browse the repository at this point in the history
minor: Add debug info to invalid offset error

cc rust-lang#17289
  • Loading branch information
bors committed Jun 5, 2024
2 parents 29e5cdf + 5a7f2dd commit 52e8065
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions crates/rust-analyzer/src/lsp/from_proto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ pub(crate) fn offset(
.ok_or_else(|| format_err!("Invalid wide col offset"))?
}
};
let text_size =
line_index.index.offset(line_col).ok_or_else(|| format_err!("Invalid offset"))?;
let text_size = line_index.index.offset(line_col).ok_or_else(|| {
format_err!("Invalid offset {line_col:?} (line index length: {:?})", line_index.index.len())
})?;
Ok(text_size)
}

Expand Down

0 comments on commit 52e8065

Please sign in to comment.