diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-04-22 02:18:20 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-04-22 02:18:20 +0800 |
commit | b85ff57a116fb252a0da35e525264e0940af88c7 (patch) | |
tree | f347bf477a6e8294e6f8601e8a5bbacb8e77c9d7 /test/diagnostics | |
parent | 264a3dbd41121ea975f934a6281a2b0781507fe0 (diff) | |
download | lua-language-server-b85ff57a116fb252a0da35e525264e0940af88c7.zip |
fix `unused-function` does not recognize recursion
Diffstat (limited to 'test/diagnostics')
-rw-r--r-- | test/diagnostics/common.lua | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/test/diagnostics/common.lua b/test/diagnostics/common.lua index b8d3d18a..e6808784 100644 --- a/test/diagnostics/common.lua +++ b/test/diagnostics/common.lua @@ -286,6 +286,12 @@ TEST [[ local <!function f() end!> ]] +TEST [[ +local <!function f() + f() +end!> +]] + config.get(nil, 'Lua.diagnostics.disable')['unused-local'] = nil TEST [[ local mt, x @@ -494,11 +500,10 @@ _ = 1, <!2!> ]] TEST [[ -local function x() +function X() do local k print(k) - x() end local k = 1 print(k) @@ -506,9 +511,8 @@ end ]] TEST [[ -local function x() +function X() local loc - x() print(loc) end ]] |