diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2023-02-06 14:15:30 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2023-02-06 14:15:30 +0800 |
commit | 95e3888ea49effefadd473d071b429a52975f688 (patch) | |
tree | 74c35413c46c3a298ac7ae91c92a373e73d1641d /script/core/command | |
parent | d3aceea058482e856c0cac2d55eec421d176b611 (diff) | |
download | lua-language-server-95e3888ea49effefadd473d071b429a52975f688.zip |
update API `setConfig`, `getConfig`
Diffstat (limited to 'script/core/command')
-rw-r--r-- | script/core/command/getConfig.lua | 7 | ||||
-rw-r--r-- | script/core/command/setConfig.lua | 10 |
2 files changed, 14 insertions, 3 deletions
diff --git a/script/core/command/getConfig.lua b/script/core/command/getConfig.lua index 86a06b88..dd0b504b 100644 --- a/script/core/command/getConfig.lua +++ b/script/core/command/getConfig.lua @@ -1,5 +1,10 @@ local config = require 'config' +local ws = require 'workspace' +---@async return function (data) - return config.get(data[1].uri, data[1].key) + local uri = data[1].uri + local key = data[1].key + ws.awaitReady(uri) + return config.get(uri, key) end diff --git a/script/core/command/setConfig.lua b/script/core/command/setConfig.lua index 84062dd1..c61aa942 100644 --- a/script/core/command/setConfig.lua +++ b/script/core/command/setConfig.lua @@ -1,5 +1,11 @@ local client = require 'client' +local ws = require 'workspace' -return function (data) - client.setConfig(data) +---@async +---@param changes config.change[] +return function (changes) + for _, change in ipairs(changes) do + ws.awaitReady(change.uri) + end + client.setConfig(changes) end |