When a global table variable is assigned multiple times — a common pattern in API definition files or defensive initialization like:
GlobalScope = GlobalScope or {}
code completion (intellisense) stops working for that table and its members.
Expected behavior:
The LSP should merge or resolve the type information across multiple assignments and continue providing code completion.
Actual behavior:
Code completion is unavailable after the table is reassigned, even if the type can be statically inferred.
Reproduction:
-- file: api1.lua
GlobalScope = {}
GlobalScope.foo = function() end
-- file: api2.lua
GlobalScope = {} -- or GlobalScope = GlobalScope or {}
GlobalScope.bar = function() end
-- file: main.lua
GlobalScope. -- no completion suggestions
When a global table variable is assigned multiple times — a common pattern in API definition files or defensive initialization like:
code completion (intellisense) stops working for that table and its members.
Expected behavior:
The LSP should merge or resolve the type information across multiple assignments and continue providing code completion.
Actual behavior:
Code completion is unavailable after the table is reassigned, even if the type can be statically inferred.
Reproduction: