Add a native Luau (.d.luau) backend for LAD files
Problem
ladfile_builder ships LAD post-processors for the Lua Language Server (--- @class .lua) and mdbook, but there's no native Luau one. luau-lsp can't consume the LuaLS dialect — it expects declare class … end / declare name: T syntax.
The luau runtime feature already exists, so you can run Luau scripts against Bevy, but there's currently no way to type-check them against the reflection registry.
Proposal
A native Luau backend in ladfile_builder, behind a luau_files feature, mirroring how lua_language_server_files is wired:
- a pure
lad_to_luau(&LadFile, …) -> String conversion, and
- a
LuauLadPlugin implementing LadFilePlugin, added to default_processors().
It would be a feature-gated module rather than a separate crate (like the LuaLS backend), since it's pure string generation over the ladfile types and needs no new dependencies.
Scope of a first cut:
declare class for reflected types (with focus_crates to keep output readable), host global functions, and non-static instance handles like world;
- handle Luau grammar edges (reserved words, the unit type, static-vs-instance globals);
- unknown types resolve to
any.
Add a native Luau (
.d.luau) backend for LAD filesProblem
ladfile_builderships LAD post-processors for the Lua Language Server (--- @class.lua) and mdbook, but there's no native Luau one.luau-lspcan't consume the LuaLS dialect — it expectsdeclare class … end/declare name: Tsyntax.The
luauruntime feature already exists, so you can run Luau scripts against Bevy, but there's currently no way to type-check them against the reflection registry.Proposal
A native Luau backend in
ladfile_builder, behind aluau_filesfeature, mirroring howlua_language_server_filesis wired:lad_to_luau(&LadFile, …) -> Stringconversion, andLuauLadPluginimplementingLadFilePlugin, added todefault_processors().It would be a feature-gated module rather than a separate crate (like the LuaLS backend), since it's pure string generation over the
ladfiletypes and needs no new dependencies.Scope of a first cut:
declare classfor reflected types (withfocus_cratesto keep output readable), host global functions, and non-static instance handles likeworld;any.