Skip to content

Commit 8d88cec

Browse files
committed
fix first semantic token is dropped
fix #2081
1 parent 71885b1 commit 8d88cec

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

changelog.md

+2
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@
44
* `FIX` commandline parameter `checklevel` may not work
55
* `FIX` [#2036]
66
* `FIX` [#2037]
7+
* `FIX` [#2081]
78

89
[#2036]: https://github.com/LuaLS/lua-language-server/issues/2036
910
[#2037]: https://github.com/LuaLS/lua-language-server/issues/2037
11+
[#2081]: https://github.com/LuaLS/lua-language-server/issues/2081
1012

1113
## 3.6.18
1214
`2023-3-23`

script/core/semantic-tokens.lua

+2-2
Original file line numberDiff line numberDiff line change
@@ -711,7 +711,7 @@ local function buildTokens(state, results)
711711
local lastLine = 0
712712
local lastStartChar = 0
713713
local index = 0
714-
for _, source in ipairs(results) do
714+
for i, source in ipairs(results) do
715715
local startPos = source.start
716716
local finishPos = source.finish
717717
local line = startPos.line
@@ -720,7 +720,7 @@ local function buildTokens(state, results)
720720
local deltaStartChar
721721
if deltaLine == 0 then
722722
deltaStartChar = startChar - lastStartChar
723-
if deltaStartChar == 0 then
723+
if deltaStartChar == 0 and i > 1 then
724724
goto continue
725725
end
726726
else

0 commit comments

Comments
 (0)