diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2019-01-22 17:07:19 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2019-01-22 17:07:19 +0800 |
commit | 73d85a0172ba551e82487cf62c9565ecd4f2753f (patch) | |
tree | 22bbd1995b01728ba8dd504e3121d78940186d06 /server/src | |
parent | f6cf28b71d81785a29a163a82427a9276744793e (diff) | |
download | lua-language-server-73d85a0172ba551e82487cf62c9565ecd4f2753f.zip |
需要调整一下初始化的顺序
Diffstat (limited to 'server/src')
-rw-r--r-- | server/src/method/initialized.lua | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/server/src/method/initialized.lua b/server/src/method/initialized.lua index 3ee4a965..fd5cd617 100644 --- a/server/src/method/initialized.lua +++ b/server/src/method/initialized.lua @@ -2,7 +2,7 @@ local rpc = require 'rpc' local workspace = require 'workspace' local config = require 'config' -return function (lsp) +local function initAfterConfig(lsp) -- 请求工作目录 rpc:request('workspace/workspaceFolders', nil, function (folders) if folders then @@ -13,17 +13,6 @@ return function (lsp) end end end) - -- 请求配置 - rpc:request('workspace/configuration', { - items = { - { - section = 'Lua', - }, - }, - }, function (configs) - config:setConfig(configs[1]) - lsp:reCompile() - end) -- 必须动态注册的事件: rpc:request('client/registerCapability', { registrations = { @@ -49,5 +38,19 @@ return function (lsp) }, function () log.debug('client/registerCapability Success!') end) +end + +return function (lsp) + -- 请求配置 + rpc:request('workspace/configuration', { + items = { + { + section = 'Lua', + }, + }, + }, function (configs) + config:setConfig(configs[1]) + initAfterConfig(lsp) + end) return true end |