LuaLS / LuaLS/lua-language-server
Support enums within tables
还没有人认领这个 Issue。
- 主要语言
- Lua
- 星标
- 4.4k
- 派生
- 442
- PR 合并指标
- 30 天内没有已合并 PR
描述
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.
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
将 issue #1411 与此 issue 一起阅读,以了解 runtime-value 的限制以及所请求的后续上下文。使用 nested-table enum 示例和屏幕截图作为行为参考。完成的标准是,函数参数补全能够根据 enumerator 的定义位置建议 enum 值,包括嵌套在表中的 enum。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- lua
- 领域
- devtools
- Issue 类型
- 功能
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100