diff options
| author | DanielGavin <danielgavin5@hotmail.com> | 2025-09-27 22:08:25 +0200 |
|---|---|---|
| committer | DanielGavin <danielgavin5@hotmail.com> | 2025-09-27 22:08:25 +0200 |
| commit | fadba86f623fd0c0e0399b88b79804c5e466ef95 (patch) | |
| tree | dc33bec9b25c5f93f79ba8a14b78e8abfd63cdd3 /src/common | |
| parent | 2be257718c637e2f42b760fe9acca3eb7674530a (diff) | |
Have the removed imports remove the line.
Diffstat (limited to 'src/common')
| -rw-r--r-- | src/common/position.odin | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/common/position.odin b/src/common/position.odin index e5dc2bd..4d01f58 100644 --- a/src/common/position.odin +++ b/src/common/position.odin @@ -133,6 +133,20 @@ get_token_range :: proc(node: ast.Node, document_text: string) -> (range: Range) return } +get_last_column :: proc(line: int, document_text: []u8) -> (int, bool) { + line_count := 0 + index := 1 + last := document_text[0] + + if !get_index_at_line(&index, &line_count, &last, document_text[:], line) { + return {}, false + } + + column := get_character_offset_u8_to_u16(100000, document_text[index:]) + + return column, true +} + get_absolute_range :: proc(range: Range, document_text: []u8) -> (AbsoluteRange, bool) { absolute: AbsoluteRange |