summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2023-03-06 20:57:29 +0800
committer最萌小汐 <sumneko@hotmail.com>2023-03-06 20:57:29 +0800
commit3c994c639b87febc8aa515bea145e32338e658a9 (patch)
tree581af5e385ed9cfcce62b613fc59282c2a34bab9 /script
parent0b1b3b65f4fc19cec980e9b253a26353c628c2b2 (diff)
downloadlua-language-server-3c994c639b87febc8aa515bea145e32338e658a9.zip
check multilneTokenSupport
fix #1753
Diffstat (limited to 'script')
-rw-r--r--script/client.lua2
-rw-r--r--script/core/semantic-tokens.lua4
2 files changed, 4 insertions, 2 deletions
diff --git a/script/client.lua b/script/client.lua
index f39202a6..a8eda9b8 100644
--- a/script/client.lua
+++ b/script/client.lua
@@ -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
diff --git a/script/core/semantic-tokens.lua b/script/core/semantic-tokens.lua
index 60a94281..3d322a3e 100644
--- a/script/core/semantic-tokens.lua
+++ b/script/core/semantic-tokens.lua
@@ -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'
@@ -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,