diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2020-12-16 10:11:52 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2020-12-16 10:11:52 +0800 |
commit | 4ab165a5940b3e41ea2932b899406d70fb1b964e (patch) | |
tree | 32d4c3ab4f7f8d55850e08e612b7792d20888854 | |
parent | 4b995d60acb4d54169de9d3e3baf5c4fab408593 (diff) | |
download | lua-language-server-4ab165a5940b3e41ea2932b899406d70fb1b964e.zip |
wrong test
-rw-r--r-- | script/core/diagnostics/unused-function.lua | 2 | ||||
-rw-r--r-- | test/diagnostics/init.lua | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/script/core/diagnostics/unused-function.lua b/script/core/diagnostics/unused-function.lua index 1463d081..a68b8dcc 100644 --- a/script/core/diagnostics/unused-function.lua +++ b/script/core/diagnostics/unused-function.lua @@ -32,7 +32,7 @@ return function (uri, callback) and parent.type ~= 'setlocal' then return end - if isToBeClosed(source) then + if isToBeClosed(parent) then return end local hasGet diff --git a/test/diagnostics/init.lua b/test/diagnostics/init.lua index cfd0f4cb..aa921c19 100644 --- a/test/diagnostics/init.lua +++ b/test/diagnostics/init.lua @@ -319,6 +319,10 @@ return [[ ]] ]=] +TEST [[ +local _ <close> = function () end +]] + config.config.diagnostics.disable['unused-local'] = true TEST [[ local f = <!function () end!> @@ -824,10 +828,6 @@ TEST [[ local t ]] -TEST [[ -local _ <close> = function () end -]] - -- checkUndefinedField 通用 TEST [[ ---@class Foo |