summaryrefslogtreecommitdiff
path: root/script/client.lua
diff options
context:
space:
mode:
authorkevinhwang91 <kevin.hwang@live.com>2022-04-12 21:24:49 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-04-12 23:14:54 +0800
commita4459732c15f740e409cbe09ad9a96bda2023741 (patch)
tree5dec0971ad2ede0c35186ec6cb88ec36b9ba61ee /script/client.lua
parent66504f8099f4369a9a436bfef12b6f1a92fbf084 (diff)
downloadlua-language-server-a4459732c15f740e409cbe09ad9a96bda2023741.zip
fix(client): reuse the previous keys for config
In .luarc, we use key without `Lua.` prefix which is good for completion through schema.
Diffstat (limited to 'script/client.lua')
-rw-r--r--script/client.lua8
1 files changed, 7 insertions, 1 deletions
diff --git a/script/client.lua b/script/client.lua
index 07520937..daa9bc52 100644
--- a/script/client.lua
+++ b/script/client.lua
@@ -211,7 +211,13 @@ local function applyConfig(cfg, uri, changes)
for _, change in ipairs(changes) do
if scp:isChildUri(change.uri)
or scp:isLinkedUri(change.uri) then
- cfg[change.key] = config.getRaw(change.uri, change.key)
+ local value = config.getRaw(change.uri, change.key)
+ local key = change.key:match('^Lua%.(.+)$')
+ if cfg[key] then
+ cfg[key] = value
+ else
+ cfg[change.key] = value
+ end
ok = true
end
end