summaryrefslogtreecommitdiff
path: root/script/vm/ref.lua
diff options
context:
space:
mode:
Diffstat (limited to 'script/vm/ref.lua')
-rw-r--r--script/vm/ref.lua20
1 files changed, 16 insertions, 4 deletions
diff --git a/script/vm/ref.lua b/script/vm/ref.lua
index 545c294a..fbb9d015 100644
--- a/script/vm/ref.lua
+++ b/script/vm/ref.lua
@@ -279,10 +279,22 @@ local function searchByDef(source, pushResult)
defMap[source] = true
return defMap
end
- local defs = vm.getDefs(source)
- for _, def in ipairs(defs) do
- pushResult(def)
- defMap[def] = true
+ if source.type == 'field'
+ or source.type == 'method' then
+ source = source.parent
+ end
+ defMap[source] = true
+ if guide.isSet(source) then
+ local defs = vm.getDefs(source)
+ for _, def in ipairs(defs) do
+ pushResult(def)
+ end
+ else
+ local defs = vm.getDefs(source)
+ for _, def in ipairs(defs) do
+ pushResult(def)
+ defMap[def] = true
+ end
end
return defMap
end