Skip to main content

Crate luau_analyze

Crate luau_analyze 

Source
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§

CancellationToken
A reusable cancellation token that can be signaled from another thread.
CheckOptions
Per-call options for Checker::check_with_options.
CheckResult
Result of a single checker run.
Checker
Reusable checker instance with persistent global definitions.
CheckerOptions
Default checker configuration used by Checker.
CheckerPolicy
Stable checker policy values exposed by this crate.
Diagnostic
A single diagnostic item from checking Luau source.
EntrypointParam
One parameter extracted from a direct functional entrypoint.
EntrypointSchema
Parsed schema for a direct return function(...) ... end chunk.

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(...) ... end chunk.