diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2020-11-16 11:07:03 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2020-11-16 11:07:03 +0800 |
commit | 4e23000383857307e33ec255fe71e2e020413615 (patch) | |
tree | 53d689987cde76577b3a04da3283b24797daf130 /script-beta/core/diagnostics | |
parent | 6576326add050eb308249c69f9f5ee42d788d72f (diff) | |
download | lua-language-server-4e23000383857307e33ec255fe71e2e020413615.zip |
未使用的函数不检查全局函数(有可能导出给外部使用了)
Diffstat (limited to 'script-beta/core/diagnostics')
-rw-r--r-- | script-beta/core/diagnostics/unused-function.lua | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/script-beta/core/diagnostics/unused-function.lua b/script-beta/core/diagnostics/unused-function.lua index 2bf3084a..f0bca613 100644 --- a/script-beta/core/diagnostics/unused-function.lua +++ b/script-beta/core/diagnostics/unused-function.lua @@ -10,15 +10,14 @@ return function (uri, callback) if not ast then return end - -- 只检查局部函数与全局函数 + -- 只检查局部函数 guide.eachSourceType(ast.ast, 'function', function (source) local parent = source.parent if not parent then return end if parent.type ~= 'local' - and parent.type ~= 'setlocal' - and parent.type ~= 'setglobal' then + and parent.type ~= 'setlocal' then return end local hasGet |