diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2020-07-21 18:47:27 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2020-07-21 18:47:27 +0800 |
commit | 7a9f26241cec312c0c7930bcc71ca4f70a31facc (patch) | |
tree | 7ad18ad3744d96fc29157538dbe9fc26241e3f6c /script/method | |
parent | 408991b4d15724906ec9dc8d62a9f1579effd384 (diff) | |
download | lua-language-server-7a9f26241cec312c0c7930bcc71ca4f70a31facc.zip |
将协议放到主线程解析
Diffstat (limited to 'script/method')
-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 |