diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-12-01 20:04:35 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-12-01 20:04:35 +0800 |
commit | 671f1f4562ff284530c4be5a4296bf8ddb42b90a (patch) | |
tree | 0e2ff141fa9e8f6ef530a4403c97b2e5572a1d15 /script/client.lua | |
parent | 3fba691469ae30b06575174bbd151cc460b7b132 (diff) | |
download | lua-language-server-671f1f4562ff284530c4be5a4296bf8ddb42b90a.zip |
#831
add tests
Diffstat (limited to 'script/client.lua')
-rw-r--r-- | script/client.lua | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/script/client.lua b/script/client.lua index c9169d3c..6618752c 100644 --- a/script/client.lua +++ b/script/client.lua @@ -204,12 +204,15 @@ end ---@field global? boolean ---@field uri? uri ----@param uri uri +---@param uri uri? ---@param changes config.change[] ---@return config.change[] local function getValidChanges(uri, changes) - local scp = scope.getScope(uri) local newChanges = {} + if not uri then + return changes + end + local scp = scope.getScope(uri) for _, change in ipairs(changes) do if scp:isChildUri(change.uri) or scp:isLinkedUri(change.uri) then @@ -429,6 +432,9 @@ function m.setConfig(changes, onlyMemory) xpcall(function () local ws = require 'workspace' if #ws.folders == 0 then + if tryModifySpecifiedConfig(nil, finalChanges) then + return + end tryModifyClient(nil, finalChanges) return end |