summaryrefslogtreecommitdiff
path: root/script/provider/capability.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-01-06 21:18:58 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-01-06 21:18:58 +0800
commit6f76cb75f205bc2343ac0155abbcb2f23a764d10 (patch)
tree8e65688e0a130212b18ebadc386b3356ebe70fa3 /script/provider/capability.lua
parent1cb6288aa6f5fe4c79d96bdf82890b637a068784 (diff)
downloadlua-language-server-6f76cb75f205bc2343ac0155abbcb2f23a764d10.zip
update semantic-tokens
Diffstat (limited to 'script/provider/capability.lua')
-rw-r--r--script/provider/capability.lua21
1 files changed, 20 insertions, 1 deletions
diff --git a/script/provider/capability.lua b/script/provider/capability.lua
index 439978d6..8a1424ca 100644
--- a/script/provider/capability.lua
+++ b/script/provider/capability.lua
@@ -1,11 +1,22 @@
-local sp = require 'bee.subprocess'
local nonil = require 'without-check-nil'
local client = require 'client'
local platform = require 'bee.platform'
local completion = require 'provider.completion'
+local define = require 'proto.define'
require 'provider.semantic-tokens'
+local function toArray(map)
+ local array = {}
+ for k in pairs(map) do
+ array[#array+1] = k
+ end
+ table.sort(array, function (a, b)
+ return map[a] < map[b]
+ end)
+ return array
+end
+
local m = {}
local function testFileEvents(initer)
@@ -93,6 +104,14 @@ function m.getIniter()
firstTriggerCharacter = '\n',
moreTriggerCharacter = nil, -- string[]
},
+ semanticTokensProvider = {
+ legend = {
+ tokenTypes = toArray(define.TokenTypes),
+ tokenModifiers = toArray(define.TokenModifiers),
+ },
+ range = true,
+ full = false,
+ },
--documentOnTypeFormattingProvider = {
-- firstTriggerCharacter = '}',
--},