summaryrefslogtreecommitdiff
path: root/server/src/core
diff options
context:
space:
mode:
authorsumneko <sumneko@hotmail.com>2019-04-03 20:52:00 +0800
committersumneko <sumneko@hotmail.com>2019-04-03 20:52:00 +0800
commit619303cbf0fed55ed6c8baec6e3b9d873f68207b (patch)
tree5ca77a432f40c80c704ae1c8edce5a675d8a8e54 /server/src/core
parent8989f2503db172023f14ab1715709267fe87e371 (diff)
downloadlua-language-server-619303cbf0fed55ed6c8baec6e3b9d873f68207b.zip
修正某些未定义全局变量被诊断为重载_ENV后未定义的bug
Diffstat (limited to 'server/src/core')
-rw-r--r--server/src/core/diagnostics.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/server/src/core/diagnostics.lua b/server/src/core/diagnostics.lua
index c38d563b..a0cbb23d 100644
--- a/server/src/core/diagnostics.lua
+++ b/server/src/core/diagnostics.lua
@@ -64,7 +64,7 @@ function mt:searchUndefinedGlobal(callback)
if not parent then
return
end
- if not parent:get 'ENV' then
+ if not parent:get 'ENV' and not source:get 'in index' then
return
end
if definedGlobal[name] then
@@ -301,6 +301,9 @@ function mt:searchUndefinedEnvChild(callback)
if name == '' then
return
end
+ if source:get 'in index' then
+ return
+ end
local parent = source:get 'parent'
if parent:get 'ENV' then
return