Home

Awesome

This project has be deprecated in favour of https://github.com/JohnnyMorganz/luau-lsp#standalone - functionality has been merged there to ease maintainability

luau-analyze with Rojo support

A fork of Luau's luau-analyze tool, with Rojo support

This tool adds in support for Rojo requires, using a project.json file as a source map. It also adds in support to registering global types from an API dump.

Installation

[tools]
luau-analyze = { source = "JohnnyMorganz/luau-analyze-rojo", version = "*" }
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
cmake --build . --target luau-analyze-rojo --config Release

Usage

luau-analyze --project=default.project.json --defs=globalTypes.d.lua fileToAnalyse.luau

The tool supports all options available in the original luau-analyze tool, with these further additions:

<!-- - `--sourcemap=PATH`: path to a Rojo-style [source map](https://github.com/rojo-rbx/rojo/pull/530) --> <!-- [**DEPRECATED: use `--sourcemap=PATH` instead**] -->

Further options:

Note that --defs supports being listed multiple times, to handle multiple different definition files:

luau-analyze --defs=globalTypes.d.lua --defs=extraTypes.d.lua fileToAnalyse.luau

Limit flags:

Internal Luau flags can be modified and set using --flag:NAME=value. Changing flags may permit the typechecker to work on complex code at the cost of performance. We don't have good documentation on how these flags affect behaviour.

All available flags and their defaults can be listed using luau-analyze-rojo --show-flags

Registering global types

You can create a definition file to register as global types.

NOTE: definition file syntax is currently unstable and is undocumented, it can change at any time

The project comes with a tool to automate pulling in the latest API dump and converting it into types

python dumpRobloxTypes.py > globalTypes.d.lua

Supported Features:

Note: in non-strict mode, some unknown requires are silently ignored. If it seems a require hasn't resolved correctly, use strict mode (--!strict) to warn about unknown requires (i.e., ones which were not able to resolve to a virtual path)

If a require does not correctly resolve, please file a bug report.