summaryrefslogtreecommitdiff
path: root/script/vm/tracer.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2023-01-10 21:07:48 +0800
committer最萌小汐 <sumneko@hotmail.com>2023-01-10 21:07:48 +0800
commit5188c59384eee1b0a58b041f877c983788e9c3bf (patch)
treebbf545738acbd7fc6205392fd8b68440c283ff96 /script/vm/tracer.lua
parent709ec79260b448db181ea854d8288b334a812bb4 (diff)
downloadlua-language-server-5188c59384eee1b0a58b041f877c983788e9c3bf.zip
stash
Diffstat (limited to 'script/vm/tracer.lua')
-rw-r--r--script/vm/tracer.lua18
1 files changed, 8 insertions, 10 deletions
diff --git a/script/vm/tracer.lua b/script/vm/tracer.lua
index 65a329ca..a08d255c 100644
--- a/script/vm/tracer.lua
+++ b/script/vm/tracer.lua
@@ -97,11 +97,11 @@ function mt:collectLocal()
self.assigns[#self.assigns+1] = self.source
self.assignMap[self.source] = true
- local varInfo = vm.getVariableInfoByName(self.source, self.name)
+ local variable = vm.getVariableInfoByCodeName(self.source, self.name)
- assert(varInfo)
+ assert(variable)
- for _, set in ipairs(varInfo.sets) do
+ for _, set in ipairs(variable.sets) do
self.assigns[#self.assigns+1] = set
self.assignMap[set] = true
self:collectCare(set)
@@ -110,7 +110,7 @@ function mt:collectLocal()
end
end
- for _, get in ipairs(varInfo.gets) do
+ for _, get in ipairs(variable.gets) do
self:collectCare(get)
self.getMap[get] = true
if get.finish > finishPos then
@@ -831,14 +831,12 @@ function vm.traceNode(source)
mode = 'global'
name = base.global:getCodeName()
else
- base = vm.getVariableHead(source)
- if not base then
- return nil
- end
- name = vm.getVariableName(source)
- if not name then
+ local variable = vm.getVariable(source)
+ if not variable then
return nil
end
+ base = variable.base
+ name = variable:getCodeName()
mode = 'local'
end
local tracer = createTracer(mode, base, name)