Expand description
In-process Luau type checking for Rust.
§Example
use luau_analyze::Checker;
let mut checker = Checker::new().expect("checker should initialize");
checker
.add_definitions(
r#"
declare class TodoBuilder
function content(self, content: string): TodoBuilder
end
declare Todo: { create: () -> TodoBuilder }
"#,
)
.expect("definitions should load");
let result = checker.check(
r#"
--!strict
local _todo = Todo.create():content("review")
"#,
);
assert!(result.is_ok());Structs§
- Cancellation
Token - A reusable cancellation token that can be signaled from another thread.
- Check
Options - Per-call options for
Checker::check_with_options. - Check
Result - Result of a single checker run.
- Checker
- Reusable checker instance with persistent global definitions.
- Checker
Options - Default checker configuration used by
Checker. - Checker
Policy - Stable checker policy values exposed by this crate.
- Diagnostic
- A single diagnostic item from checking Luau source.
- Entrypoint
Param - One parameter extracted from a direct functional entrypoint.
- Entrypoint
Schema - Parsed schema for a direct
return function(...) ... endchunk.
Enums§
- Error
- Errors returned by checker construction and definition loading.
- Severity
- Diagnostic severity emitted by the checker.
Functions§
- checker_
policy - Returns the current fixed checker policy.
- extract_
entrypoint_ schema - Extracts parameter names, annotation text, and optionality from a direct
return function(...) ... endchunk.