diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2021-05-27 17:39:27 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2021-05-27 17:39:27 +0800 |
commit | 1110e83bb47345a487aa78cc343ef501b86f7d4b (patch) | |
tree | fb15e32cbf03f8363e4fb1fc0a0cebc1ce626728 /script/core/noder.lua | |
parent | 507bb6852f6ae523dca4370c38cac8581329a2c3 (diff) | |
download | lua-language-server-1110e83bb47345a487aa78cc343ef501b86f7d4b.zip |
update
Diffstat (limited to 'script/core/noder.lua')
-rw-r--r-- | script/core/noder.lua | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/script/core/noder.lua b/script/core/noder.lua index 58144a27..8d5b9a07 100644 --- a/script/core/noder.lua +++ b/script/core/noder.lua @@ -126,6 +126,10 @@ local function getKey(source) return source.start, nil elseif source.type == '...' then return source.start, nil + elseif source.type == 'varargs' then + if source.node then + return source.node.start, nil + end elseif source.type == 'select' then return ('%d%s%d'):format(source.start, RETURN_INDEX, source.sindex) elseif source.type == 'call' then @@ -576,6 +580,9 @@ function m.compileNode(noders, source) pushBackward(noders, funcXID, id) end end + if source.vararg.type == 'varargs' then + pushForward(noders, id, getID(source.vararg)) + end end if source.type == 'doc.type.function' then if source.returns then @@ -695,6 +702,16 @@ function m.compileNode(noders, source) end end end + if source.type == 'table' then + if #source == 1 and source[1].type == 'varargs' then + source.array = source[1] + local nodeID = ('%s%s'):format( + id, + ANY_FIELD + ) + pushForward(noders, nodeID, getID(source[1])) + end + end if source.type == 'main' then if source.returns then for _, rtn in ipairs(source.returns) do |