summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2018-12-26 16:51:02 +0800
committer最萌小汐 <sumneko@hotmail.com>2018-12-26 16:51:02 +0800
commit05aabcc4c4f731bd7df2bcee03d1d51fda6aab45 (patch)
treeedc3eca01d39630c2df1230f1a1251691c74bfef /server
parente13cadbd01e6f7e80c9bd02553d373d2136dec19 (diff)
downloadlua-language-server-05aabcc4c4f731bd7df2bcee03d1d51fda6aab45.zip
过滤掉特殊名字
Diffstat (limited to 'server')
-rw-r--r--server/src/matcher/diagnostics.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/server/src/matcher/diagnostics.lua b/server/src/matcher/diagnostics.lua
index 9fc26ada..584a0cb5 100644
--- a/server/src/matcher/diagnostics.lua
+++ b/server/src/matcher/diagnostics.lua
@@ -5,6 +5,7 @@ local function searchUnusedLocals(results, callback)
if var.key == 'self'
or var.key == '_'
or var.key == '_ENV'
+ or var.key == ''
then
goto NEXT_VAR
end
@@ -33,7 +34,7 @@ local function searchUndefinedGlobal(results, callback)
goto NEXT_VAR
end
local lIndex = index:lower()
- if lIndex == 'log' or lIndex == 'arg' then
+ if lIndex == 'log' or lIndex == 'arg' or lIndex == '' then
goto NEXT_VAR
end
if not index:find '%l' then
@@ -117,6 +118,7 @@ local function searchRedefinition(results, uri, callback)
for _, var in ipairs(results.locals) do
if var.key == '_'
or var.key == '_ENV'
+ or var.key == ''
then
goto NEXT_VAR
end