lsp: Fix semantic token positions

This commit is contained in:
Szepesi Tibor 2024-06-20 13:38:12 +02:00
parent aac834e1c5
commit 6bae860326
No known key found for this signature in database
GPG key ID: 267861FBA1D15AA6

View file

@ -102,10 +102,10 @@ class OpenFile:
] ]
# convert line, column numbers to deltas # convert line, column numbers to deltas
for i, token_list in enumerate(token_lists[1:]): for a, b in zip(token_lists[-2::-1], token_lists[:0:-1]):
token_list[0] -= token_lists[i][0] b[0] -= a[0]
if token_list[0] == 0: if b[0] == 0:
token_list[1] -= token_lists[i][1] b[1] -= a[1]
# flatten the list # flatten the list
return [x for y in token_lists for x in y] return [x for y in token_lists for x in y]