diff options
author | Nayeem Rahman <nayeemrmn99@gmail.com> | 2024-05-04 21:48:06 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-04 21:48:06 +0100 |
commit | 973743b7511510f33d85be6e4e3111c6db31cecf (patch) | |
tree | 8fa592a6fc939239ead9934b35457fc58049254b /cli/lsp/text.rs | |
parent | d81e97f92fe41d54e956104011fe0b1ba6c325eb (diff) |
fix(lsp): handle multiline semantic tokens (#23691)
Diffstat (limited to 'cli/lsp/text.rs')
-rw-r--r-- | cli/lsp/text.rs | 4 |
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() } |