diff options
author | Ruin0x11 <ipickering2@gmail.com> | 2020-05-25 19:16:45 -0700 |
---|---|---|
committer | Ruin0x11 <ipickering2@gmail.com> | 2020-05-25 19:25:36 -0700 |
commit | 9dc816f99f4a4329a3daff55a7199a8265a00c2c (patch) | |
tree | d400a9cb6f1a897913ff9fe56d7d0e83c45c078b /script/method/workspace/didChangeConfiguration.lua | |
parent | 0583236680b16588c52c7c98ac5a3f8a7071b868 (diff) | |
download | lua-language-server-9dc816f99f4a4329a3daff55a7199a8265a00c2c.zip |
Support multiple workspace folders
Diffstat (limited to 'script/method/workspace/didChangeConfiguration.lua')
-rw-r--r-- | script/method/workspace/didChangeConfiguration.lua | 47 |
1 files changed, 25 insertions, 22 deletions
diff --git a/script/method/workspace/didChangeConfiguration.lua b/script/method/workspace/didChangeConfiguration.lua index ecaa9182..eca61ebc 100644 --- a/script/method/workspace/didChangeConfiguration.lua +++ b/script/method/workspace/didChangeConfiguration.lua @@ -1,27 +1,30 @@ local rpc = require 'rpc' +--- @param lsp LSP return function (lsp) - local uri = lsp.workspace and lsp.workspace.uri - -- 请求配置 - rpc:request('workspace/configuration', { - items = { - { - scopeUri = uri, - section = 'Lua', + for _, ws in ipairs(lsp.workspaces) do + local uri = ws.uri + -- 请求配置 + rpc:request('workspace/configuration', { + items = { + { + scopeUri = uri, + section = 'Lua', + }, + { + scopeUri = uri, + section = 'files.associations', + }, + { + scopeUri = uri, + section = 'files.exclude', + } }, - { - scopeUri = uri, - section = 'files.associations', - }, - { - scopeUri = uri, - section = 'files.exclude', - } - }, - }, function (configs) - lsp:onUpdateConfig(configs[1], { - associations = configs[2], - exclude = configs[3], - }) - end) + }, function (configs) + lsp:onUpdateConfig(configs[1], { + associations = configs[2], + exclude = configs[3], + }) + end) + end end |