diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2021-05-15 17:44:53 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2021-05-15 17:44:53 +0800 |
commit | 43fdd200c89cc4356e50ccf4bd4f4a94bc1ae701 (patch) | |
tree | 29c7a02ceb25ffb2ce4c0fe74fc4f4b32d9748d1 /script | |
parent | 91c8da46833320274f874250d21b71da05cf9689 (diff) | |
download | lua-language-server-43fdd200c89cc4356e50ccf4bd4f4a94bc1ae701.zip |
update
Diffstat (limited to 'script')
-rw-r--r-- | script/core/linker.lua | 6 | ||||
-rw-r--r-- | script/core/searcher.lua | 3 | ||||
-rw-r--r-- | script/parser/ast.lua | 2 |
3 files changed, 6 insertions, 5 deletions
diff --git a/script/core/linker.lua b/script/core/linker.lua index b1dc8476..e1be2323 100644 --- a/script/core/linker.lua +++ b/script/core/linker.lua @@ -107,7 +107,7 @@ local function getKey(source) elseif source.type == '...' then return source.start, nil elseif source.type == 'select' then - return ('%d%s%d'):format(source.start, RETURN_INDEX, source.index) + return ('%d%s%d'):format(source.start, RETURN_INDEX, source.sindex) elseif source.type == 'call' then local node = source.node if node.special == 'rawget' @@ -522,14 +522,14 @@ function m.compileLink(source) local callXID = ('%s%s%s'):format( nodeID, RETURN_INDEX, - source.index + source.sindex ) pushForward(id, callXID) pushBackward(callXID, id) getLink(id).call = call if node.special == 'pcall' or node.special == 'xpcall' then - local index = source.index - 1 + local index = source.sindex - 1 if index <= 0 then return end diff --git a/script/core/searcher.lua b/script/core/searcher.lua index 4af50da6..a2e673ef 100644 --- a/script/core/searcher.lua +++ b/script/core/searcher.lua @@ -60,7 +60,8 @@ function m.pushResult(status, mode, source) results[#results+1] = source end end - if parent.type == 'return' then + if parent.type == 'return' + or parent.type == 'callargs' then if linker.getID(source) ~= status.id then results[#results+1] = source end diff --git a/script/parser/ast.lua b/script/parser/ast.lua index b2a9fa37..b029b1ec 100644 --- a/script/parser/ast.lua +++ b/script/parser/ast.lua @@ -110,7 +110,7 @@ local function getSelect(vararg, index) start = vararg.start, finish = vararg.finish, vararg = vararg, - index = index, + sindex = index, } end |