summaryrefslogtreecommitdiff
path: root/script/vm/tracer.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2023-01-09 17:15:22 +0800
committer最萌小汐 <sumneko@hotmail.com>2023-01-09 17:15:22 +0800
commitc796d406329170e010590d7c9584b8483021cee3 (patch)
treea4f43228c38847acaf968aea1e46c8df3d88ec17 /script/vm/tracer.lua
parent78875f59fe2fa846d62bf955805b647d17cf87d2 (diff)
downloadlua-language-server-c796d406329170e010590d7c9584b8483021cee3.zip
support trace for global
Diffstat (limited to 'script/vm/tracer.lua')
-rw-r--r--script/vm/tracer.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/script/vm/tracer.lua b/script/vm/tracer.lua
index 025a6ae1..d4b9e5be 100644
--- a/script/vm/tracer.lua
+++ b/script/vm/tracer.lua
@@ -214,6 +214,7 @@ end
local lookIntoChild = util.switch()
: case 'getlocal'
+ : case 'getglobal'
---@param tracer vm.tracer
---@param action parser.object
---@param topNode vm.node
@@ -466,7 +467,7 @@ local lookIntoChild = util.switch()
and call.args then
local getVar = call.args[1]
if getVar
- and tracer.assignMap[getVar] then
+ and tracer.getMap[getVar] then
for _, ref in ipairs(action.ref) do
tracer:collectCare(ref)
end
@@ -694,7 +695,7 @@ end
---@param source parser.object
function mt:calcNode(source)
if self.getMap[source] then
- local lastAssign = self:getLastAssign(0, source.start)
+ local lastAssign = self:getLastAssign(0, source.finish)
if not lastAssign then
lastAssign = source.node
end