summaryrefslogtreecommitdiff
path: root/cli/lsp/text.rs
diff options
context:
space:
mode:
Diffstat (limited to 'cli/lsp/text.rs')
-rw-r--r--cli/lsp/text.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/cli/lsp/text.rs b/cli/lsp/text.rs
index 6a5f36fb0..88f27915b 100644
--- a/cli/lsp/text.rs
+++ b/cli/lsp/text.rs
@@ -185,6 +185,10 @@ impl LineIndex {
}
}
+ pub fn line_length_utf16(&self, line: u32) -> TextSize {
+ self.utf16_offsets[(line + 1) as usize] - self.utf16_offsets[line as usize]
+ }
+
pub fn text_content_length_utf16(&self) -> TextSize {
*self.utf16_offsets.last().unwrap()
}