summaryrefslogtreecommitdiff
path: root/script/provider/provider.lua
diff options
context:
space:
mode:
Diffstat (limited to 'script/provider/provider.lua')
-rw-r--r--script/provider/provider.lua24
1 files changed, 23 insertions, 1 deletions
diff --git a/script/provider/provider.lua b/script/provider/provider.lua
index f10fb66e..dbeb9804 100644
--- a/script/provider/provider.lua
+++ b/script/provider/provider.lua
@@ -149,7 +149,6 @@ m.register 'initialized'{
})
end
client.setReady()
- library.init()
workspace.init()
return true
end
@@ -234,6 +233,29 @@ m.register 'workspace/didRenameFiles' {
end
}
+m.register 'workspace/didChangeWorkspaceFolders' {
+ capability = {
+ workspace = {
+ workspaceFolders = {
+ supported = true,
+ changeNotifications = true,
+ },
+ },
+ },
+ ---@async
+ function (params)
+ log.debug('workspace/didChangeWorkspaceFolders', inspect(params))
+ for _, folder in ipairs(params.event.added) do
+ workspace.create(folder.uri)
+ updateConfig()
+ workspace.reload(scope.getScope(folder.uri))
+ end
+ for _, folder in ipairs(params.event.removed) do
+ workspace.remove(folder.uri)
+ end
+ end
+}
+
m.register 'textDocument/didOpen' {
function (params)
local doc = params.textDocument