diff options
| author | bors <bors@rust-lang.org> | 2024-06-05 08:21:47 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-06-05 08:21:47 +0000 |
| commit | 02c178b780d1dbfd496c9bf828d139a1671ce79b (patch) | |
| tree | f3fbfa11d0183aeb56042669e231284a63e01b6d | |
| parent | 4c007c86bb9e96bff51033c61f7c5d1a31472eae (diff) | |
| parent | 955989431270443ca37955d55e97fa1e711fd870 (diff) | |
| download | rust-02c178b780d1dbfd496c9bf828d139a1671ce79b.tar.gz rust-02c178b780d1dbfd496c9bf828d139a1671ce79b.zip | |
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
| -rw-r--r-- | src/tools/rust-analyzer/crates/rust-analyzer/src/lsp/from_proto.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/tools/rust-analyzer/crates/rust-analyzer/src/lsp/from_proto.rs b/src/tools/rust-analyzer/crates/rust-analyzer/src/lsp/from_proto.rs index b6b20296d80..60fe847bb7d 100644 --- a/src/tools/rust-analyzer/crates/rust-analyzer/src/lsp/from_proto.rs +++ b/src/tools/rust-analyzer/crates/rust-analyzer/src/lsp/from_proto.rs @@ -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) } |
