summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
Diffstat (limited to 'script')
-rw-r--r--script/config/template.lua2
-rw-r--r--script/utility.lua4
2 files changed, 4 insertions, 2 deletions
diff --git a/script/config/template.lua b/script/config/template.lua
index fa0c2772..850f2b4e 100644
--- a/script/config/template.lua
+++ b/script/config/template.lua
@@ -239,7 +239,7 @@ local template = {
>> util.deepCopy(define.BuiltIn),
['Lua.diagnostics.enable'] = Type.Boolean >> true,
['Lua.diagnostics.globals'] = Type.Array(Type.String),
- ['Lua.diagnostics.disable'] = Type.Array(Type.String << util.getTableKeys(diag.getDiagAndErrNameMap())),
+ ['Lua.diagnostics.disable'] = Type.Array(Type.String << util.getTableKeys(diag.getDiagAndErrNameMap(), true)),
['Lua.diagnostics.severity'] = Type.Hash(
Type.String << util.getTableKeys(define.DiagnosticDefaultNeededFileStatus, true),
Type.String << {
diff --git a/script/utility.lua b/script/utility.lua
index 8e6c6a88..66beaf07 100644
--- a/script/utility.lua
+++ b/script/utility.lua
@@ -799,6 +799,8 @@ function m.multiTable(count, default)
return current
end
+---@param t table
+---@param sorter boolean|function
function m.getTableKeys(t, sorter)
local keys = {}
for k in pairs(t) do
@@ -806,7 +808,7 @@ function m.getTableKeys(t, sorter)
end
if sorter == true then
tableSort(keys)
- elseif sorter then
+ elseif type(sorter) == 'function' then
tableSort(keys, sorter)
end
return keys