Skip to content

Commit 52e8065

Browse files
committed
Auto merge of #17347 - Veykril:inv-offset-err, r=Veykril
minor: Add debug info to invalid offset error cc #17289
2 parents 29e5cdf + 5a7f2dd commit 52e8065

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

crates/rust-analyzer/src/lsp/from_proto.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,9 @@ pub(crate) fn offset(
3737
.ok_or_else(|| format_err!("Invalid wide col offset"))?
3838
}
3939
};
40-
let text_size =
41-
line_index.index.offset(line_col).ok_or_else(|| format_err!("Invalid offset"))?;
40+
let text_size = line_index.index.offset(line_col).ok_or_else(|| {
41+
format_err!("Invalid offset {line_col:?} (line index length: {:?})", line_index.index.len())
42+
})?;
4243
Ok(text_size)
4344
}
4445

0 commit comments

Comments
 (0)