summaryrefslogtreecommitdiff
path: root/script/src/method/workspace/didChangeConfiguration.lua
diff options
context:
space:
mode:
Diffstat (limited to 'script/src/method/workspace/didChangeConfiguration.lua')
-rw-r--r--script/src/method/workspace/didChangeConfiguration.lua27
1 files changed, 27 insertions, 0 deletions
diff --git a/script/src/method/workspace/didChangeConfiguration.lua b/script/src/method/workspace/didChangeConfiguration.lua
new file mode 100644
index 00000000..ecaa9182
--- /dev/null
+++ b/script/src/method/workspace/didChangeConfiguration.lua
@@ -0,0 +1,27 @@
+local rpc = require 'rpc'
+
+return function (lsp)
+ local uri = lsp.workspace and lsp.workspace.uri
+ -- 请求配置
+ rpc:request('workspace/configuration', {
+ items = {
+ {
+ scopeUri = uri,
+ section = 'Lua',
+ },
+ {
+ scopeUri = uri,
+ section = 'files.associations',
+ },
+ {
+ scopeUri = uri,
+ section = 'files.exclude',
+ }
+ },
+ }, function (configs)
+ lsp:onUpdateConfig(configs[1], {
+ associations = configs[2],
+ exclude = configs[3],
+ })
+ end)
+end