summaryrefslogtreecommitdiff
path: root/script/provider/semantic-tokens.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-04-16 00:26:13 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-04-16 00:26:13 +0800
commit8b5c02c49fa397a40f03dc5c27dd6872dee13b2c (patch)
treee32be7bba8631552620d8e0c9c418749b7985192 /script/provider/semantic-tokens.lua
parentc4f70450e6727a693586ad7941581ac51014545c (diff)
downloadlua-language-server-8b5c02c49fa397a40f03dc5c27dd6872dee13b2c.zip
move inlay-hint to LSP
Diffstat (limited to 'script/provider/semantic-tokens.lua')
-rw-r--r--script/provider/semantic-tokens.lua41
1 files changed, 2 insertions, 39 deletions
diff --git a/script/provider/semantic-tokens.lua b/script/provider/semantic-tokens.lua
index 2fa75064..80416fff 100644
--- a/script/provider/semantic-tokens.lua
+++ b/script/provider/semantic-tokens.lua
@@ -1,46 +1,10 @@
local proto = require 'proto'
-local define = require 'proto.define'
local client = require 'client'
local json = require "json"
local config = require 'config'
-local lang = require 'language'
-local nonil = require 'without-check-nil'
-local dontShowAgain = false
-local function check(uri)
- if dontShowAgain then
- return
- end
- dontShowAgain = true
- nonil.disable()
- if config.get(uri, 'editor.semanticHighlighting.enabled') == 'configuredByTheme' then
- proto.request('window/showMessageRequest', {
- type = define.MessageType.Info,
- message = lang.script.WINDOW_CHECK_SEMANTIC,
- actions = {
- {
- title = lang.script.WINDOW_APPLY_SETTING,
- },
- {
- title = lang.script.WINDOW_DONT_SHOW_AGAIN,
- },
- }
- }, function (item)
- if not item then
- return
- end
- if item.title == lang.script.WINDOW_APPLY_SETTING then
- client.setConfig {
- {
- key = 'editor.semanticHighlighting.enabled',
- action = 'set',
- value = true,
- global = true,
- }
- }
- end
- end)
- end
+if not client.getAbility 'workspace.semanticTokens.refreshSupport' then
+ return
end
local function refresh()
@@ -49,7 +13,6 @@ local function refresh()
end
log.debug('Refresh semantic tokens.')
proto.request('workspace/semanticTokens/refresh', json.null)
- --check()
end
config.watch(function (uri, key, value, oldValue)