summaryrefslogtreecommitdiff
path: root/script/method/initialize.lua
diff options
context:
space:
mode:
Diffstat (limited to 'script/method/initialize.lua')
-rw-r--r--script/method/initialize.lua10
1 files changed, 9 insertions, 1 deletions
diff --git a/script/method/initialize.lua b/script/method/initialize.lua
index bc35a32b..1fb0cb5f 100644
--- a/script/method/initialize.lua
+++ b/script/method/initialize.lua
@@ -1,3 +1,5 @@
+local workspace = require 'workspace'
+
local function allWords()
local str = [[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.:('"[,#*@| ]]
local list = {}
@@ -7,8 +9,14 @@ local function allWords()
return list
end
-return function (lsp)
+return function (lsp, params)
lsp._inited = true
+
+ if params.rootUri then
+ lsp.workspace = workspace(lsp, 'root')
+ lsp.workspace:init(params.rootUri)
+ end
+
return {
capabilities = {
completionProvider = {