summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--changelog.md5
-rw-r--r--script/client.lua2
-rw-r--r--script/core/semantic-tokens.lua4
3 files changed, 9 insertions, 2 deletions
diff --git a/changelog.md b/changelog.md
index 83d2681e..654e4de0 100644
--- a/changelog.md
+++ b/changelog.md
@@ -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
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,