diff options
Diffstat (limited to 'script/method/initialize.lua')
-rw-r--r-- | script/method/initialize.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/script/method/initialize.lua b/script/method/initialize.lua index 79fc51f7..23a920f0 100644 --- a/script/method/initialize.lua +++ b/script/method/initialize.lua @@ -21,11 +21,11 @@ return function (lsp, params) client.init(params) log.info(table.dump(params)) - if params.workspaceFolders ~= json.null then + if params.workspaceFolders and params.workspaceFolders ~= json.null then for _, folder in ipairs(params.workspaceFolders) do lsp:addWorkspace(folder.name, folder.uri) end - elseif params.rootUri then + elseif params.rootUri and params.rootUri ~= json.null then lsp:addWorkspace('root', params.rootUri) end |