summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-01-05 20:19:13 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-01-05 20:19:13 +0800
commite89ccc2b6ea6be1282f9da80f366c267bccf5efc (patch)
treedd76d61e476b3050e1cfe27482a6040094b480e0
parent70e83968473caa16355a380e7a4ab438f5fdd00a (diff)
downloadlua-language-server-e89ccc2b6ea6be1282f9da80f366c267bccf5efc.zip
fix completion
-rw-r--r--script/config/config.lua4
-rw-r--r--script/provider/completion.lua4
-rw-r--r--script/provider/semantic-tokens.lua4
3 files changed, 11 insertions, 1 deletions
diff --git a/script/config/config.lua b/script/config/config.lua
index 6aefac44..a83470d4 100644
--- a/script/config/config.lua
+++ b/script/config/config.lua
@@ -418,10 +418,12 @@ function m.update(scp, ...)
for key, oldValue in pairs(oldConfig) do
local newValue = newConfig[key]
if not util.equal(oldValue, newValue) then
- m.event(scp.uri, key, oldValue, newValue)
+ m.event(scp.uri, key, newValue, oldValue)
end
end
end
+
+ m.event(scp.uri, '')
end
---@param callback fun(uri: uri, key: string, value: any, oldValue: any)
diff --git a/script/provider/completion.lua b/script/provider/completion.lua
index ec2ac6c7..9bcccc66 100644
--- a/script/provider/completion.lua
+++ b/script/provider/completion.lua
@@ -71,6 +71,10 @@ local function disable(uri)
end
config.watch(function (uri, key, value)
+ if key == '' then
+ key = 'Lua.completion.enable'
+ value = config.get(uri, key)
+ end
if key == 'Lua.completion.enable' then
if value == true then
enable(uri)
diff --git a/script/provider/semantic-tokens.lua b/script/provider/semantic-tokens.lua
index f6acb280..b867359f 100644
--- a/script/provider/semantic-tokens.lua
+++ b/script/provider/semantic-tokens.lua
@@ -110,6 +110,10 @@ local function refresh()
end
config.watch(function (uri, key, value, oldValue)
+ if key == '' then
+ key = 'Lua.color.mode'
+ value = config.get(uri, key)
+ end
if key == 'Lua.color.mode' then
if value == 'Semantic' or value == 'SemanticEnhanced' then
if isEnable and value ~= oldValue then