summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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