Skip to content

Commit 95e3888

Browse files
committed
update API setConfig, getConfig
1 parent d3aceea commit 95e3888

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

script/core/command/getConfig.lua

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
local config = require 'config'
2+
local ws = require 'workspace'
23

4+
---@async
35
return function (data)
4-
return config.get(data[1].uri, data[1].key)
6+
local uri = data[1].uri
7+
local key = data[1].key
8+
ws.awaitReady(uri)
9+
return config.get(uri, key)
510
end

script/core/command/setConfig.lua

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
local client = require 'client'
2+
local ws = require 'workspace'
23

3-
return function (data)
4-
client.setConfig(data)
4+
---@async
5+
---@param changes config.change[]
6+
return function (changes)
7+
for _, change in ipairs(changes) do
8+
ws.awaitReady(change.uri)
9+
end
10+
client.setConfig(changes)
511
end

0 commit comments

Comments
 (0)