diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-06-07 21:27:45 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-06-07 21:27:45 +0800 |
commit | 680e6c9848a6e5f43ccce11561ec98839822bdea (patch) | |
tree | 829e587428002e9fdd3f82364c39490d2c3f0c24 /script/config/template.lua | |
parent | 5762f1bdc412a128489f0ad27124193fedfb13e9 (diff) | |
download | lua-language-server-680e6c9848a6e5f43ccce11561ec98839822bdea.zip |
cleanup
Diffstat (limited to 'script/config/template.lua')
-rw-r--r-- | script/config/template.lua | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/script/config/template.lua b/script/config/template.lua index 968fea1b..45310c7e 100644 --- a/script/config/template.lua +++ b/script/config/template.lua @@ -42,10 +42,11 @@ local units = {} local function register(name, default, checker, loader, caller) units[name] = { - default = default, + name = name, + default = default, _checker = checker, - loader = loader, - caller = caller, + loader = loader, + caller = caller, } end @@ -194,7 +195,7 @@ local template = { ), ['Lua.runtime.meta'] = Type.String >> '${version} ${language} ${encoding}', ['Lua.runtime.unicodeName'] = Type.Boolean, - ['Lua.runtime.nonstandardSymbol'] = Type.Hash(Type.String, Type.Boolean, ';'), + ['Lua.runtime.nonstandardSymbol'] = Type.Array(Type.String), ['Lua.runtime.plugin'] = Type.String, ['Lua.runtime.fileEncoding'] = Type.String >> 'utf8' << { 'utf8', @@ -202,10 +203,17 @@ local template = { 'utf16le', 'utf16be', }, - ['Lua.runtime.builtin'] = Type.Hash(Type.String, Type.String), + ['Lua.runtime.builtin'] = Type.Hash( + Type.String << util.getTableKeys(define.BuiltIn, true), + Type.String >> 'default' << { + 'default', + 'enable', + 'disable', + } + ), ['Lua.diagnostics.enable'] = Type.Boolean >> true, - ['Lua.diagnostics.globals'] = Type.Hash(Type.String, Type.Boolean, ';'), - ['Lua.diagnostics.disable'] = Type.Hash(Type.String, Type.Boolean, ';'), + ['Lua.diagnostics.globals'] = Type.Array(Type.String), + ['Lua.diagnostics.disable'] = Type.Array(Type.String), ['Lua.diagnostics.severity'] = Type.Hash(Type.String, Type.String) >> util.deepCopy(define.DiagnosticDefaultSeverity), ['Lua.diagnostics.neededFileStatus'] = Type.Hash(Type.String, Type.String) |