diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2020-09-28 16:36:19 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2020-09-28 16:36:19 +0800 |
commit | bc1e52851c4c65ebb729d7ba7dba53b6be88ed74 (patch) | |
tree | 53eaf06225e058af8f2bb7f3ee95d40f0974ffa2 /script-beta/provider/provider.lua | |
parent | 1ce91bc1715601abc63404cd6e9e7f04b36d3aa7 (diff) | |
download | lua-language-server-bc1e52851c4c65ebb729d7ba7dba53b6be88ed74.zip |
支持多工作目录
Diffstat (limited to 'script-beta/provider/provider.lua')
-rw-r--r-- | script-beta/provider/provider.lua | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/script-beta/provider/provider.lua b/script-beta/provider/provider.lua index c5a69a43..71004c55 100644 --- a/script-beta/provider/provider.lua +++ b/script-beta/provider/provider.lua @@ -77,10 +77,8 @@ end proto.on('initialize', function (params) client.init(params) - if params.workspaceFolders then - local name = params.workspaceFolders[1].name - local uri = params.workspaceFolders[1].uri - workspace.init(name, uri) + if params.rootUri then + workspace.init(params.rootUri) end return { capabilities = cap.initer, @@ -547,10 +545,11 @@ proto.on('textDocument/codeAction', function (params) end) proto.on('workspace/executeCommand', function (params) - if params.command == 'lua.removeSpace' then + local command = params.command:gsub(':.+', '') + if command == 'lua.removeSpace' then local core = require 'core.command.removeSpace' return core(params.arguments[1]) - elseif params.command == 'lua.solve' then + elseif command == 'lua.solve' then local core = require 'core.command.solve' return core(params.arguments[1]) end |