Mantle Scripting
Local prototype for configuring Luau language support in an Unreal project using Mantle. Requires the JohnnyMorganz.luau-lsp extension.
Open the project directory or its Content directory in a single-folder VS Code window, then run Mantle: Set Up Workspace from the Command Palette. The command searches the open folder and its ancestors for a single .uproject. It configures the Luau LSP for the standard platform, disables sourcemaps, and adds Mantle's definitions while preserving other definition entries. Existing legacy definition arrays are converted to named entries.
Setup looks for ScriptTypes/mantle.d.luau in the project first, followed by Plugins/MantleCore/Resources/ScriptApi/mantle.d.luau and the extension's bundled resources/ScriptApi/mantle.d.luau. The completion message identifies the selected source and its API version when adjacent mantle_api.json metadata is available.
For each directory under Content/Packages with a Shared directory, setup adds a relative alias to the workspace .luaurc. For example, @QBCore/Client points at Packages/QBCore/Shared/Client.luau when Content is open. Existing aliases, including inherited aliases, are preserved and reported. Nested .luaurc files can override the workspace alias. Re-run setup after adding packages. Review .luaurc and .vscode/settings.json before committing them.
Open one folder per VS Code window because these Luau LSP settings apply across the window. Mantle's Regenerate Types command continues to supply project-specific definitions when needed.
For local development, install dependencies and run npm run compile. Generated ScriptApi files must be supplied in resources/ScriptApi when packaging the extension.