summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--changelog.md1
-rw-r--r--script/core/noder.lua3
-rw-r--r--test/type_inference/init.lua5
3 files changed, 8 insertions, 1 deletions
diff --git a/changelog.md b/changelog.md
index cee2349c..e184a068 100644
--- a/changelog.md
+++ b/changelog.md
@@ -29,6 +29,7 @@
* `FIX` [#790](https://github.com/sumneko/lua-language-server/issues/790)
* `FIX` [#798](https://github.com/sumneko/lua-language-server/issues/798)
* `FIX` [#804](https://github.com/sumneko/lua-language-server/issues/804)
+* `FIX` [#805](https://github.com/sumneko/lua-language-server/issues/805)
* `FIX` [#806](https://github.com/sumneko/lua-language-server/issues/806)
* `FIX` [#807](https://github.com/sumneko/lua-language-server/issues/807)
diff --git a/script/core/noder.lua b/script/core/noder.lua
index 0fc83905..374d2c9b 100644
--- a/script/core/noder.lua
+++ b/script/core/noder.lua
@@ -1036,7 +1036,8 @@ compileNodeMap = util.switch()
if src.type == 'local'
or src.type == 'tablefield'
or src.type == 'tableindex'
- or src.type == 'setglobal' then
+ or src.type == 'setglobal'
+ or guide.isGlobal(src) then
if src.parent.type ~= 'funcargs'
and not src.dummy then
pushForward(noders, getID(src), id)
diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua
index c76e372c..871b4ef8 100644
--- a/test/type_inference/init.lua
+++ b/test/type_inference/init.lua
@@ -992,3 +992,8 @@ local mt
---@type number
function mt:f(<?x?>) end
]]
+
+TEST 'Test' [[
+---@class Test
+_G.<?Test?> = {}
+]]