summaryrefslogtreecommitdiff
path: root/server/src/config.lua
diff options
context:
space:
mode:
authorsumneko <sumneko@hotmail.com>2019-05-14 18:16:50 +0800
committersumneko <sumneko@hotmail.com>2019-05-14 18:16:50 +0800
commitfbcf341dc3fcee82e891177c5ed54a20aad21bac (patch)
tree63b5cf6d3fa29afdb1ccf5d377eaad98c5928882 /server/src/config.lua
parent3d287daa2c2f2a1643ac80f6ce6d0efe4a384bb1 (diff)
downloadlua-language-server-fbcf341dc3fcee82e891177c5ed54a20aad21bac.zip
更新配置
Diffstat (limited to 'server/src/config.lua')
-rw-r--r--server/src/config.lua27
1 files changed, 22 insertions, 5 deletions
diff --git a/server/src/config.lua b/server/src/config.lua
index 176e3ce9..7ee2c959 100644
--- a/server/src/config.lua
+++ b/server/src/config.lua
@@ -79,6 +79,19 @@ local function Hash(keyChecker, valueChecker)
end
end
+local function Or(...)
+ local checkers = {...}
+ return function (obj)
+ for _, checker in ipairs(checkers) do
+ local suc, res = checker(obj)
+ if suc then
+ return true, res
+ end
+ end
+ return false
+ end
+end
+
local ConfigTemplate = {
runtime = {
version = {'Lua 5.3', String},
@@ -98,11 +111,15 @@ local ConfigTemplate = {
},
},
workspace = {
- ignoreDir = {{}, Str2Hash ';'},
- ignoreSubmodules= {true, Boolean},
- useGitIgnore = {true, Boolean},
- maxPreload = {300, Integer},
- preloadFileSize = {100, Integer},
+ ignoreDir = {{}, Str2Hash ';'},
+ ignoreSubmodules= {true, Boolean},
+ useGitIgnore = {true, Boolean},
+ maxPreload = {300, Integer},
+ preloadFileSize = {100, Integer},
+ library = {{}, Hash(
+ String,
+ Or(Boolean, Array(String))
+ )}
}
}