diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2021-07-08 18:03:05 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2021-07-08 18:03:05 +0800 |
commit | b596e9d2a5091f9554182e14ede258b6330e7fc1 (patch) | |
tree | 3cf7023adbae5cc4135f74114f62f64fdf0567c4 | |
parent | a02199fa6845a330a3d6fd3a324c168befeede33 (diff) | |
download | lua-language-server-b596e9d2a5091f9554182e14ede258b6330e7fc1.zip |
change setting may failed
-rw-r--r-- | changelog.md | 4 | ||||
-rw-r--r-- | script/client.lua | 6 | ||||
-rw-r--r-- | script/library.lua | 8 |
3 files changed, 11 insertions, 7 deletions
diff --git a/changelog.md b/changelog.md index 85b126b0..696295c3 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,9 @@ # changelog +## 2.2.1 +`2021-7-8` +* `FIX` change setting may failed + ## 2.2.0 `2021-7-8` * `NEW` detect and apply third-party libraries, including: 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 |