LuaLS / LuaLS/lua-language-server
[Feature Request] Add a strong typed struct/class that cannot assign a new field that is not defined in the struct/class.
Open
Nobody has claimed this yet.
enhancement
- Dominant language
- Lua
- Stars
- 4.4k
- Forks
- 442
- PR merge metrics
- No merged PRs in 30d
Description
- 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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No files, tests, or entry points are named. Use the Student example as the starting specification and inspect the existing type-checking tests and diagnostics; done means an extra tobacco_level field is rejected while the declared study_level field remains accepted.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua
- Domain
- devtools
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100