diff options
Diffstat (limited to 'server-beta/src/searcher/eachRef.lua')
-rw-r--r-- | server-beta/src/searcher/eachRef.lua | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/server-beta/src/searcher/eachRef.lua b/server-beta/src/searcher/eachRef.lua index 649206e6..8f6b5c2f 100644 --- a/server-beta/src/searcher/eachRef.lua +++ b/server-beta/src/searcher/eachRef.lua @@ -78,7 +78,17 @@ local function ofValue(value, callback) source = value, mode = 'value', } - searcher.eachRef(value, callback) + local parent = value.parent + if parent.type == 'local' + or parent.type == 'setglobal' + or parent.type == 'setlocal' + or parent.type == 'setfield' + or parent.type == 'setmethod' + or parent.type == 'setindex' then + if parent.value == value then + searcher.eachRef(parent, callback) + end + end end local function ofSelf(loc, callback) @@ -325,7 +335,8 @@ local function eachRef(source, callback) ofGoTo(source, callback) elseif stype == 'label' then ofLabel(source, callback) - elseif stype == 'table' then + elseif stype == 'table' + or stype == 'function' then ofValue(source, callback) elseif stype == 'main' then ofMain(source, callback) |