summaryrefslogtreecommitdiff
path: root/script/core
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-01-10 20:41:30 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-01-10 20:41:30 +0800
commite112035b49171693d2c492e329eae2df23ad0c87 (patch)
tree3be82b760d539a3ef0adab21bca75e82aeaf0223 /script/core
parent14760a600837ec760fd9874bcc1076db4cfeb7dc (diff)
downloadlua-language-server-e112035b49171693d2c492e329eae2df23ad0c87.zip
fix
Diffstat (limited to 'script/core')
-rw-r--r--script/core/semantic-tokens.lua18
1 files changed, 8 insertions, 10 deletions
diff --git a/script/core/semantic-tokens.lua b/script/core/semantic-tokens.lua
index b4b05149..806615fe 100644
--- a/script/core/semantic-tokens.lua
+++ b/script/core/semantic-tokens.lua
@@ -474,12 +474,12 @@ local function solveMultilineAndOverlapping(state, results)
local startRow, startCol = guide.rowColOf(token.start)
local finishRow, finishCol = guide.rowColOf(token.finish)
if finishRow > startRow then
- token.finish = guide.positionOf(startRow, 9999)
+ token.finish = guide.positionOf(startRow, guide.getLineRange(state, startRow))
end
for i = startRow + 1, finishRow - 1 do
new[#new+1] = {
start = guide.positionOf(i, 0),
- finish = guide.positionOf(i, 9999),
+ finish = guide.positionOf(i, guide.getLineRange(state, i)),
type = token.type,
modifieres = token.modifieres,
}
@@ -487,7 +487,7 @@ local function solveMultilineAndOverlapping(state, results)
if finishCol > 0 then
new[#new+1] = {
start = guide.positionOf(finishRow, 0),
- finish = token.finish,
+ finish = guide.positionOf(finishRow, finishCol),
type = token.type,
modifieres = token.modifieres,
}
@@ -525,13 +525,11 @@ return function (uri, start, finish)
end)
for _, comm in ipairs(state.comms) do
- if comm.type == 'comment.cshort' then
- results[#results+1] = {
- start = comm.start,
- finish = comm.finish,
- type = define.TokenTypes.comment,
- }
- end
+ results[#results+1] = {
+ start = comm.start,
+ finish = comm.finish,
+ type = define.TokenTypes.comment,
+ }
end
if #results == 0 then