summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2018-12-24 13:46:24 +0800
committer最萌小汐 <sumneko@hotmail.com>2018-12-24 13:46:24 +0800
commita723536198162aef5297fa7dc05d20597895bda8 (patch)
tree117458276365b6d981fdd93168c86bd02b6994a3
parent7b752a3eae03e714911adf5508b9aa27d079d2bb (diff)
downloadlua-language-server-a723536198162aef5297fa7dc05d20597895bda8.zip
不再因为多次引用全局变量而忽略警告
-rw-r--r--server/src/matcher/diagnostics.lua3
-rw-r--r--server/test/diagnostics/init.lua11
2 files changed, 0 insertions, 14 deletions
diff --git a/server/src/matcher/diagnostics.lua b/server/src/matcher/diagnostics.lua
index 7871bdca..5e51f9ac 100644
--- a/server/src/matcher/diagnostics.lua
+++ b/server/src/matcher/diagnostics.lua
@@ -37,9 +37,6 @@ local function searchUndefinedGlobal(results, callback)
if not index:find '%l' then
goto NEXT_VAR
end
- if #field >= 3 then
- goto NEXT_VAR
- end
for _, info in ipairs(field) do
if info.type == 'set' then
goto NEXT_VAR
diff --git a/server/test/diagnostics/init.lua b/server/test/diagnostics/init.lua
index fc425e6b..57a54e4d 100644
--- a/server/test/diagnostics/init.lua
+++ b/server/test/diagnostics/init.lua
@@ -102,17 +102,6 @@ print(x)
]]
TEST [[
-local x
-print(x)
-local x
-print(x)
-local x
-print(x)
-local x
-print(x)
-]]
-
-TEST [[
local _
print(_)
local _