diff options
Diffstat (limited to 'server-beta/src/core/diagnostics/unused-function.lua')
-rw-r--r-- | server-beta/src/core/diagnostics/unused-function.lua | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/server-beta/src/core/diagnostics/unused-function.lua b/server-beta/src/core/diagnostics/unused-function.lua index 80123948..0886660d 100644 --- a/server-beta/src/core/diagnostics/unused-function.lua +++ b/server-beta/src/core/diagnostics/unused-function.lua @@ -11,12 +11,16 @@ return function (uri, callback) end guide.eachSourceType(ast.ast, 'function', function (source) local hasGet + local hasSet searcher.eachRef(source, function (info) - if info.mode == 'get' then + if info.mode == 'get' then hasGet = true + elseif info.mode == 'set' + or info.mode == 'declare' then + hasSet = true end end) - if not hasGet then + if not hasGet and hasSet then callback { start = source.start, finish = source.finish, |