diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2020-12-30 11:59:43 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2020-12-30 11:59:43 +0800 |
commit | 69ddc8410def956d75d6429befbc2d1872fb6af7 (patch) | |
tree | d61f9a00c2455293d42027e26ab96e8fdd30b2c7 /script/provider | |
parent | fc8ee4d41abfe6d8385ceb221d358488b0936513 (diff) | |
download | lua-language-server-69ddc8410def956d75d6429befbc2d1872fb6af7.zip |
refresh semantic tokens
Diffstat (limited to 'script/provider')
-rw-r--r-- | script/provider/provider.lua | 2 | ||||
-rw-r--r-- | script/provider/semantic-tokens.lua | 9 |
2 files changed, 10 insertions, 1 deletions
diff --git a/script/provider/provider.lua b/script/provider/provider.lua index c71b14fa..6512f1e7 100644 --- a/script/provider/provider.lua +++ b/script/provider/provider.lua @@ -54,6 +54,7 @@ local function updateConfig() if not util.equal(oldConfig.runtime, newConfig.runtime) then library.init() workspace.reload() + semantic.refresh() end if not util.equal(oldConfig.diagnostics, newConfig.diagnostics) then diagnostics.diagnosticsAll() @@ -66,6 +67,7 @@ local function updateConfig() or not util.equal(oldOther.exclude, newOther.exclude) then workspace.reload() + semantic.refresh() end if not util.equal(oldConfig.intelliSense, newConfig.intelliSense) then files.flushCache() diff --git a/script/provider/semantic-tokens.lua b/script/provider/semantic-tokens.lua index 65235509..e4b2fc6f 100644 --- a/script/provider/semantic-tokens.lua +++ b/script/provider/semantic-tokens.lua @@ -1,6 +1,7 @@ local proto = require 'proto' local define = require 'proto.define' local client = require 'provider.client' +local json = require "json" local isEnable = false @@ -58,7 +59,13 @@ local function disable() }) end +local function refresh() + log.debug('Refresh semantic tokens.') + proto.notify('workspace/semanticTokens/refresh', json.null) +end + return { - enable = enable, + enable = enable, disable = disable, + refresh = refresh, } |