summaryrefslogtreecommitdiff
path: root/script/provider
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-11-25 20:28:11 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-11-25 20:28:11 +0800
commit24f4dfa889cc66bd05223e5d8d36fa19865c772b (patch)
treebae27e55ab5d7baebffc035d8da22249421def2c /script/provider
parentbf9e6936218ff6f84ff6fc17c3e6cb0e46d81488 (diff)
downloadlua-language-server-24f4dfa889cc66bd05223e5d8d36fa19865c772b.zip
create workspaces in server
Diffstat (limited to 'script/provider')
-rw-r--r--script/provider/provider.lua14
1 files changed, 13 insertions, 1 deletions
diff --git a/script/provider/provider.lua b/script/provider/provider.lua
index 7f025f78..c0cee9c7 100644
--- a/script/provider/provider.lua
+++ b/script/provider/provider.lua
@@ -87,7 +87,19 @@ m.register 'initialize' {
function (params)
client.init(params)
config.init()
- workspace.initPath(params.rootUri)
+
+ if params.rootUri then
+ workspace.initRoot(params.rootUri)
+ end
+
+ if params.workspaceFolders then
+ for _, folder in ipairs(params.workspaceFolders) do
+ workspace.create(folder.uri)
+ end
+ elseif params.rootUri then
+ workspace.create(params.rootUri)
+ end
+
return {
capabilities = cap.getIniter(),
serverInfo = {