Auto merge of #17347 - Veykril:inv-offset-err, r=Veykril
minor: Add debug info to invalid offset error cc https://github.com/rust-lang/rust-analyzer/issues/17289
This commit is contained in:
commit
02c178b780
1 changed files with 3 additions and 2 deletions
|
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue