summaryrefslogtreecommitdiff
path: root/script-beta
diff options
context:
space:
mode:
Diffstat (limited to 'script-beta')
-rw-r--r--script-beta/core/completion.lua22
1 files changed, 13 insertions, 9 deletions
diff --git a/script-beta/core/completion.lua b/script-beta/core/completion.lua
index 2b0b8e93..aff4d9f3 100644
--- a/script-beta/core/completion.lua
+++ b/script-beta/core/completion.lua
@@ -1156,11 +1156,13 @@ local function tryLuaDocByErr(ast, offset, err, docState, results)
local label = {}
local insertText = {}
for i, arg in ipairs(func.args) do
- label[i] = arg[1]
- if i == 1 then
- insertText[i] = ('%s any'):format(arg[1])
- else
- insertText[i] = ('---@param %s any'):format(arg[1])
+ if arg[1] then
+ label[#label+1] = arg[1]
+ if i == 1 then
+ insertText[i] = ('%s any'):format(arg[1])
+ else
+ insertText[i] = ('---@param %s any'):format(arg[1])
+ end
end
end
results[#results+1] = {
@@ -1169,10 +1171,12 @@ local function tryLuaDocByErr(ast, offset, err, docState, results)
insertText = table.concat(insertText, '\n'),
}
for i, arg in ipairs(func.args) do
- results[#results+1] = {
- label = arg[1],
- kind = define.CompletionItemKind.Interface,
- }
+ if arg[1] then
+ results[#results+1] = {
+ label = arg[1],
+ kind = define.CompletionItemKind.Interface,
+ }
+ end
end
end
end