diff options
author | sumneko <sumneko@hotmail.com> | 2019-04-03 20:52:00 +0800 |
---|---|---|
committer | sumneko <sumneko@hotmail.com> | 2019-04-03 20:52:00 +0800 |
commit | 619303cbf0fed55ed6c8baec6e3b9d873f68207b (patch) | |
tree | 5ca77a432f40c80c704ae1c8edce5a675d8a8e54 /server/src/core | |
parent | 8989f2503db172023f14ab1715709267fe87e371 (diff) | |
download | lua-language-server-619303cbf0fed55ed6c8baec6e3b9d873f68207b.zip |
修正某些未定义全局变量被诊断为重载_ENV后未定义的bug
Diffstat (limited to 'server/src/core')
-rw-r--r-- | server/src/core/diagnostics.lua | 5 |
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 |