mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
lsp: Implement semantic tokens
This commit is contained in:
parent
7a65956195
commit
dfb09b9357
6 changed files with 65 additions and 5 deletions
|
@ -73,7 +73,7 @@ def idx_to_pos(idx: int, text: str) -> T.Tuple[int, int]:
|
|||
sp = text[:idx].splitlines(keepends=True)
|
||||
line_num = len(sp)
|
||||
col_num = len(sp[-1])
|
||||
return (line_num, col_num)
|
||||
return (line_num - 1, col_num)
|
||||
|
||||
def pos_to_idx(line: int, col: int, text: str) -> int:
|
||||
lines = text.splitlines(keepends=True)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue