Lua declarations: type registrations by their value type
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 30/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
调研方向
Start with the generated Lua declarations and the bindings used by World.get_type_by_name, get_component, get_resource, bms.construct, and get_asset; the issue gives no file paths. Check the LuaLS diagnostics from the stated --check run, then study the open pull request #661 and the type-table issue mentioned here. Done means registrations and values carry useful inferred types and the reported type mismatches and undefined-field diagnostics are addressed.
由索引模型根据 Issue 内容生成。
描述
Found by running LuaLS 3.19.2 --check over assets/tests/**/*.lua against declarations generated with all bevy_*_bindings features + lua54 + register_test_functions (454 problems in 92 files at the time).
Problem
Registrations carry no value type, so values from the world are untyped (~150 diagnostics).
World.get_type_by_namereturnsbms.ScriptTypeRegistration | bms.ScriptComponentRegistration | bms.ScriptResourceRegistration | bms.ScriptBundleRegistration | nil, whileadd_default_component,get_resource,insert_bundle, etc. take one specific registration →param-type-mismatchon nearly every test using a registration.get_component/get_resource/bms.construct/get_assetreturn plainReflectReference, so e.g.child_of:parent(),res.vec_usize,constructed.foo,reference:rotate_y(1.0)areundefined-field/inject-field.
Possible direction
Generic registrations (verified working in LuaLS, t infers transform.Transform|nil):
---@class bms.ScriptComponentRegistration<T> : ReflectReference
---@generic T
---@param registration bms.ScriptComponentRegistration<T>
---@return T | nil
function World.get_component(entity, registration) end
Open question: how a string lookup produces T — generated literal overloads per registered type on get_type_by_name, or only typing namespace type tables (see the type-table issue).
- 主要语言
- Rust
- 星标
- 660
- 派生
- 59
- 平均合并
- 16 小时 23 分钟
- 30 天内合并 PR
- 61
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
makspll/bevy_mod_scripting 的其他 Issue
-
CI: type-check the Lua script test suite with LuaLS可能已有人在做 @makspll 于 12 天前认领。 未关闭
难度 4/5 3-5 天 新手友好度 55/100
makspll/bevy_mod_scripting#659 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 52/100
makspll/bevy_mod_scripting#658 ·
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 30/100
makspll/bevy_mod_scripting#657 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 45/100
makspll/bevy_mod_scripting#656 ·
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 64/100
makspll/bevy_mod_scripting#655 ·
维护者通常 1 天内回复
查看 makspll/bevy_mod_scripting 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 76/100
dekobon/big-code-analysis#1859 ·
维护者通常 1 天内回复
-
agent-self
难度 2/5 1-3 小时 新手友好度 78/100
yologdev/yoyo-evolve#1160 ·
-
phase:3
难度 1/5 1 小时以内 新手友好度 86/100
pchrysostomou/ananke#214 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
eliasstravik/herdr-projects#845 ·
-
enhancement
难度 2/5 1-3 小时 新手友好度 63/100
ramensoftware/windhawk#1187 ·