LuaLS / LuaLS/lua-language-server
Support enums within tables
Nobody has claimed this yet.
- Dominant language
- Lua
- Stars
- 4.4k
- Forks
- 442
- PR merge metrics
- No merged PRs in 30d
Description
This may have to be a follow-up of https://github.com/sumneko/lua-language-server/issues/1411 but I have created this as a separate issue for separate feedback & tracking purposes
It would be nice if we could have enum function argument suggestions based on where the enumerator is defined. Currently, if you have an enum nested within some tables, it will only suggest the enum values as such:

This is fine if using the values defined directly is not an issue. However, if the enum values are runtime values (as mentioned in issue https://github.com/sumneko/lua-language-server/issues/1411) then we'd like to have some sort of initial auto-complete as such:

I am not sure how expensive computationally it may be to do this, if that is an issue then perhaps there exists a cheap workaround that could be used for documenting purposes.
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
Read issue #1411 alongside this issue to understand the runtime-value limitation and the requested follow-up context. Use the nested-table enum examples and screenshots as the behavioral reference. Done means function-argument completion can suggest enum values based on where the enumerator is defined, including enums nested within tables.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua
- Domain
- devtools
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100