lua-language-server icon indicating copy to clipboard operation
lua-language-server copied to clipboard

[Feature Request] Add a strong typed struct/class that cannot assign a new field that is not defined in the struct/class.

Open eminor1988 opened this issue 2 years ago • 63 comments

  • Example:
---@struct Student
---@field study_level integer

---@type Student
local new_student = {
    study_level = 0,
    tobacco_level = 1, -- This should be error.
}
  • Usage: We can do refactoring easier when rename the fields with this feature.

eminor1988 avatar Mar 08 '23 04:03 eminor1988