summaryrefslogtreecommitdiff
path: root/script/provider/semantic-tokens.lua
diff options
context:
space:
mode:
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)