summaryrefslogtreecommitdiff
path: root/server/src
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2019-01-02 17:53:42 +0800
committer最萌小汐 <sumneko@hotmail.com>2019-01-02 17:53:42 +0800
commit716c7904e6fd22f31862dab87eec7451b36d437b (patch)
treef6d075fdd6d264f7da9887d95dfb9af3f404f944 /server/src
parent052e45705d43bc653ade996f06d8441dc599e918 (diff)
downloadlua-language-server-716c7904e6fd22f31862dab87eec7451b36d437b.zip
修正一些bug
Diffstat (limited to 'server/src')
-rw-r--r--server/src/config.lua8
-rw-r--r--server/src/method/initialized.lua3
-rw-r--r--server/src/method/workspace/didChangeConfiguration.lua1
3 files changed, 7 insertions, 5 deletions
diff --git a/server/src/config.lua b/server/src/config.lua
index 8aff6d40..9e4ae296 100644
--- a/server/src/config.lua
+++ b/server/src/config.lua
@@ -14,7 +14,7 @@ local function Str2Hash(sep)
for s in v:gmatch('[^'..sep..']+') do
t[s] = true
end
- return t
+ return true, t
end
end
@@ -41,12 +41,12 @@ local function init()
end
end
-local function setConfig(config)
+local function setConfig(self, config)
pcall(function ()
for c, t in pairs(config) do
for k, v in pairs(t) do
- local f = Template[c][k]
- local suc, v = f(v)
+ local info = Template[c][k]
+ local suc, v = info[2](v)
if suc then
Config[c][k] = v
end
diff --git a/server/src/method/initialized.lua b/server/src/method/initialized.lua
index fa0e33cb..3ee4a965 100644
--- a/server/src/method/initialized.lua
+++ b/server/src/method/initialized.lua
@@ -21,7 +21,8 @@ return function (lsp)
},
},
}, function (configs)
- confgi:setConfig(configs[1])
+ config:setConfig(configs[1])
+ lsp:reCompile()
end)
-- 必须动态注册的事件:
rpc:request('client/registerCapability', {
diff --git a/server/src/method/workspace/didChangeConfiguration.lua b/server/src/method/workspace/didChangeConfiguration.lua
index c1240147..2052c84c 100644
--- a/server/src/method/workspace/didChangeConfiguration.lua
+++ b/server/src/method/workspace/didChangeConfiguration.lua
@@ -11,5 +11,6 @@ return function (lsp)
},
}, function (configs)
config:setConfig(configs[1])
+ lsp:reCompile()
end)
end