EmmyLua / IntelliJ-EmmyLua

Lua IDE/Debugger Plugin for IntelliJ IDEA
https://emmylua.github.io
Apache License 2.0
1.73k stars 290 forks source link

Autocomplete from __index table #456

Closed ghost closed 2 years ago

ghost commented 2 years ago

Any way to autocomplete from __index table?

Mouse = setmetatable({}, {
  __index =  { Left = 1, Right = 2 }
});

Mouse. -- Suggest the Left and Right

-- Now need the same properties with nil to work, and the __newindex to work.
Mouse = setmetatable({ Left = nil, Right = nil }, {
  __index =  { Left = 1, Right = 2 }
});