diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2019-11-15 23:47:39 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2019-11-15 23:47:39 +0800 |
commit | f4fcddfa8805848b7ce7c58188cca711fc429c3b (patch) | |
tree | 8e8b1947a40d274e7237dddab30c195bfb0ad1ae /server-beta/test | |
parent | 2862282e18315a6474001a994e385fee132753a6 (diff) | |
download | lua-language-server-f4fcddfa8805848b7ce7c58188cca711fc429c3b.zip |
诊断:未使用的函数 只检查局部函数与全局函数
Diffstat (limited to 'server-beta/test')
-rw-r--r-- | server-beta/test/diagnostics/init.lua | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/server-beta/test/diagnostics/init.lua b/server-beta/test/diagnostics/init.lua index aaf51987..40f605e6 100644 --- a/server-beta/test/diagnostics/init.lua +++ b/server-beta/test/diagnostics/init.lua @@ -297,13 +297,28 @@ return [[ ]] ]=] +config.config.diagnostics.disable['unused-local'] = true TEST [[ -local t = {} -<!function t:x() -end!> -return t +local f = <!function () end!> +]] + +TEST [[ +local f;f = <!function () end!> +]] + +TEST [[ +<!local function f() end!> +]] + +TEST [[ +F = <!function () end!> +]] + +TEST [[ +<!function F() end!> ]] +config.config.diagnostics.disable['unused-local'] = false config.config.diagnostics.disable['unused-function'] = true TEST [[ local mt, x |