Skip to content

Commit

Permalink
check multilneTokenSupport
Browse files Browse the repository at this point in the history
fix #1753
  • Loading branch information
sumneko committed Mar 6, 2023
1 parent 0b1b3b6 commit 3c994c6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
5 changes: 5 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# changelog

## 3.6.14
* `FIX` [#1753]

[#1753]: https://github.com/LuaLS/lua-language-server/issues/1753

## 3.6.13
`2023-3-2`
* `FIX` setting: `Lua.addonManager.enable` should be `true` by default
Expand Down
2 changes: 1 addition & 1 deletion script/client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function m.getAbility(name)
end
current = current[parent]
if not current then
return nil
return current
end
if nextPos > #name then
break
Expand Down
4 changes: 3 additions & 1 deletion script/core/semantic-tokens.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ local guide = require 'parser.guide'
local converter = require 'proto.converter'
local config = require 'config'
local linkedTable = require 'linked-table'
local client = require 'client'

local Care = util.switch()
: case 'getglobal'
Expand Down Expand Up @@ -794,7 +795,8 @@ local function solveMultilineAndOverlapping(state, results)
for token in tokens:pairs() do
local startPos = converter.packPosition(state, token.start)
local endPos = converter.packPosition(state, token.finish)
if endPos.line == startPos.line then
if endPos.line == startPos.line
or client.getAbility 'textDocument.semanticTokens.multilineTokenSupport' then
new[#new+1] = {
start = startPos,
finish = endPos,
Expand Down

0 comments on commit 3c994c6

Please sign in to comment.