summaryrefslogtreecommitdiff
path: root/script/core
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2023-04-25 20:02:58 +0800
committer最萌小汐 <sumneko@hotmail.com>2023-04-25 20:02:58 +0800
commit8d88cec860af5a594d120ab4e37d4cb47ac1f238 (patch)
treef00b8bd7d297eaf15c101719b14b36ed00e1d79f /script/core
parent71885b139cdae9f3d65268278882bd4793f4fe24 (diff)
downloadlua-language-server-8d88cec860af5a594d120ab4e37d4cb47ac1f238.zip
fix first semantic token is dropped
fix #2081
Diffstat (limited to 'script/core')
-rw-r--r--script/core/semantic-tokens.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/script/core/semantic-tokens.lua b/script/core/semantic-tokens.lua
index 0e27e8b8..4d191b69 100644
--- a/script/core/semantic-tokens.lua
+++ b/script/core/semantic-tokens.lua
@@ -711,7 +711,7 @@ local function buildTokens(state, results)
local lastLine = 0
local lastStartChar = 0
local index = 0
- for _, source in ipairs(results) do
+ for i, source in ipairs(results) do
local startPos = source.start
local finishPos = source.finish
local line = startPos.line
@@ -720,7 +720,7 @@ local function buildTokens(state, results)
local deltaStartChar
if deltaLine == 0 then
deltaStartChar = startChar - lastStartChar
- if deltaStartChar == 0 then
+ if deltaStartChar == 0 and i > 1 then
goto continue
end
else