English | 简体中文
This tool loads C# assemblies and converts their types into EmmyLua documentation following the standards of xLua and the LuaLS.
- Loads DLL assemblies based on .NET reflection
- Includes type annotations
@enum name: Enums, mapped astable@class name : base, interface, ...: Classes, supports base classes and interfaces
- Includes members
field: Fieldsproperty: Propertiesindexer: Indexersmethod: Methods, supports overloads, async, generics automatically interpreted by xLua, optional parameters, and variable parametersconstructor: Constructors, with the same level of support as above@operator: Operator overloads, supportsadd,sub,mul,div,unm
- Member access modifiers
@private: Private members@protected: Protected members@package: Internal members within the assembly
- Composite Type Mapping
TValue this[TKey idx]:{ [TKey]: TValue }IEnumerable<T>,IEnumerator<T>:{ [nil]: T }Nullable<T>:T|nil
- Delegate types are automatically converted to function types
- Unrecognized
userdatais mapped as composite types to provide more precise code hints
Create a JSON configuration file (refer to config.json):
{
"assemblies": [
{
"path": "path/to/assembly.dll",
"types": [
"Namespace.Type1",
"Namespace.Type2",
"*"
]
}
],
"outputDir": "output"
}assemblies- List of assemblies to loadpath- Path to the DLL file (supports relative or absolute paths)types- List of types to generate documentation for (generics are not supported)"NS1.NS2.ClassName"- Specify the full type name"NS1.NS2.ClassName+NestedClass"- Nested types
outputDir- Output directory (defaults to "output")
dotnet run -- config.json- .NET 8.0 or higher
- Generated documentation uses the
CS.prefix for namespaces, consistent with xLua - Lua keywords are automatically escaped (e.g.,
andbecomes__and__) - Except for the key generics, other types are mapped as
userdata - Compiler-generated members are automatically filtered out
- The first parameter type for operator overloads must be the same as the declaring class
- Multidimensional indexers are not supported