summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-07-08 18:03:05 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-07-08 18:03:05 +0800
commitb596e9d2a5091f9554182e14ede258b6330e7fc1 (patch)
tree3cf7023adbae5cc4135f74114f62f64fdf0567c4 /script
parenta02199fa6845a330a3d6fd3a324c168befeede33 (diff)
downloadlua-language-server-b596e9d2a5091f9554182e14ede258b6330e7fc1.zip
change setting may failed
Diffstat (limited to 'script')
-rw-r--r--script/client.lua6
-rw-r--r--script/library.lua8
2 files changed, 7 insertions, 7 deletions
diff --git a/script/client.lua b/script/client.lua
index f5078d48..1928910f 100644
--- a/script/client.lua
+++ b/script/client.lua
@@ -105,8 +105,8 @@ end
---@field uri? uri
---@param changes config.change[]
----@param updateLocal boolean
-function m.setConfig(changes, updateLocal)
+---@param onlyMemory boolean
+function m.setConfig(changes, onlyMemory)
local finalChanges = {}
for _, change in ipairs(changes) do
if change.action == 'add' then
@@ -121,7 +121,7 @@ function m.setConfig(changes, updateLocal)
end
end
end
- if not updateLocal then
+ if onlyMemory then
return
end
if #finalChanges == 0 then
diff --git a/script/library.lua b/script/library.lua
index 3cb4cb10..80a34032 100644
--- a/script/library.lua
+++ b/script/library.lua
@@ -294,7 +294,7 @@ local function load3rdConfig()
return configs
end
-local function apply3rd(cfg, localConfig)
+local function apply3rd(cfg, onlyMemory)
local changes = {}
for _, change in ipairs(cfg.configs) do
changes[#changes+1] = change
@@ -314,7 +314,7 @@ local function apply3rd(cfg, localConfig)
value = ('${3rd}/%s/library'):format(cfg.name),
}
- client.setConfig(changes, localConfig)
+ client.setConfig(changes, onlyMemory)
end
local hasAsked
@@ -338,9 +338,9 @@ local function askFor3rd(cfg)
},
}
if result == yes1 then
- apply3rd(cfg, true)
- elseif result == yes2 then
apply3rd(cfg, false)
+ elseif result == yes2 then
+ apply3rd(cfg, true)
end
end