The script editor does not recognize new metatables assigned when you try to overwrite an old metatable with a new one/when you try to get rid of it via setmetatable(t, nil)
. It keeps the autocomplete info from the first assigned metatable and never updates to reflect new changes.
Repro instructions
Copy and paste this into your script editor and observe the behaviour as outlined by the comments:
local t = setmetatable({}, { __index = { entry = true }})
t.entry --> t.entry autocompletes (as expected)
setmetatable(t, nil)
t.entry --> t.entry still autocompletes
setmetatable(t, { __index = { entry2 = true } })
t.entry --> t.entry autocompletes despite it being overwritten
t.entry2 --> t.entry2 does not autocomplete
Beta features
I have every beta feature enabled except for new studio camera controls and the new topbar
System info
AMD Ryzen 5 5600G with Radeon Graphics
48GB DDR4 RAM @ 3200MHz (47.9 usable)
NVIDIA GeForce RTX 3070Ti
Expected behavior
Autocomplete should recognize when a new metatable replaces an old/existing one.