summaryrefslogtreecommitdiff
path: root/server/src/core
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2019-01-22 16:46:52 +0800
committer最萌小汐 <sumneko@hotmail.com>2019-01-22 16:46:52 +0800
commit182d49198e023f5fa13cac2a2a99045f2020ce58 (patch)
tree26c1b9a72b759ba5cea636f1221c44e32a67d0c5 /server/src/core
parent6f4cf8d4f2551672e3bc0fe472445485c3acbe3f (diff)
downloadlua-language-server-182d49198e023f5fa13cac2a2a99045f2020ce58.zip
修正显性的self会被诊断忽略的BUG
Diffstat (limited to 'server/src/core')
-rw-r--r--server/src/core/diagnostics.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/server/src/core/diagnostics.lua b/server/src/core/diagnostics.lua
index a4f6bbcc..d88c4fc6 100644
--- a/server/src/core/diagnostics.lua
+++ b/server/src/core/diagnostics.lua
@@ -14,13 +14,15 @@ mt.__index = mt
function mt:searchUnusedLocals(callback)
local results = self.results
for _, var in ipairs(results.locals) do
- if var.key == 'self'
- or var.key == '_'
+ if var.key == '_'
or var.key == '_ENV'
or var.key == ''
then
goto NEXT_VAR
end
+ if var.hide then
+ goto NEXT_VAR
+ end
for _, info in ipairs(var) do
if info.type == 'get' then
goto NEXT_VAR