diff options
Diffstat (limited to 'script-beta/core/diagnostics')
-rw-r--r-- | script-beta/core/diagnostics/unused-function.lua | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/script-beta/core/diagnostics/unused-function.lua b/script-beta/core/diagnostics/unused-function.lua index 52c7749a..f417fd92 100644 --- a/script-beta/core/diagnostics/unused-function.lua +++ b/script-beta/core/diagnostics/unused-function.lua @@ -21,16 +21,15 @@ return function (uri, callback) and parent.type ~= 'setglobal' then return end - local hasSet local hasGet - vm.eachRef(source, function (src) - if vm.isSet(src) then - hasSet = true - else + local refs = guide.requestReference(source) + for _, src in ipairs(refs) do + if vm.isGet(src) then hasGet = true + break end - end) - if not hasGet and hasSet then + end + if not hasGet then callback { start = source.start, finish = source.finish, |