summaryrefslogtreecommitdiff
path: root/script-beta/core/diagnostics/unused-function.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2020-05-29 16:45:03 +0800
committer最萌小汐 <sumneko@hotmail.com>2020-05-29 16:45:03 +0800
commitbf15a6d9e9e3ea5e86596cd84ff4e3b4f12e29f9 (patch)
treedb51d275388a273466190fca6d9e19771507286e /script-beta/core/diagnostics/unused-function.lua
parent59afbeaed024d2610d4f514d9c1255e3394008c9 (diff)
downloadlua-language-server-bf15a6d9e9e3ea5e86596cd84ff4e3b4f12e29f9.zip
更新中
Diffstat (limited to 'script-beta/core/diagnostics/unused-function.lua')
-rw-r--r--script-beta/core/diagnostics/unused-function.lua13
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,