about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/tools/rust-analyzer/crates/rust-analyzer/src/lsp/from_proto.rs5
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)
 }