Editor Support
Luwu Community maintains luwu-lsp, Luwu's language server, and keeps it in sync with the language. It tracks Luwu's integration branch instead of master: integration represents our vision for the language by 0.1.0, and because new features wait on review before they land in master, building from integration lets you write and test them in your editor in the meantime and play with new features and find new bugs for us to fix.
luwu-lsp is built on JohnnyMorganz's luau-lsp language server and CLI and extends it with Luwu support and more features. JohnnyMorganz has kept luau-lsp in step with Luau's weekly releases for years, largely unpaid, and luwu-lsp wouldn't exist without that work.
Install for VS Code and its forks, Zed or Neovim. To report a bug, see Reporting Bugs.
Improved hovers
See Better Hovers
Hovering a type that refers to other types shows each one's docs without expanding it, with a link to where it's defined. Types print over several lines like code, at the level of detail you choose.
Friendlier type checking
See Type Checking
Luau's errors are written for Roblox Studio's one-line diagnostics. Editors like VS Code and Zed have room for more, so Luwu rewrote the type stringifier to print types formatted like code and fixed bugs in the Analysis it inherited. Errors explain their jargon in a Help note, in Luau files too.
Editors
Installer
The installer sets up luwu-lsp for VS Code and its forks, Zed and Helix. It asks which editors to set up and backs up each config before changing it. Run it again to update.
On Windows, in PowerShell:
irm 'https://raw.githubusercontent.com/luwu-community/luwu-lsp/luwu/scripts/install/install.ps1' | iexOn macOS, Linux and Android (Termux):
curl -fsSL https://raw.githubusercontent.com/luwu-community/luwu-lsp/luwu/scripts/install/install.sh | shVS Code and Code - OSS editors
Run the installer and pick your editor. It works for VS Code and its forks, like VSCodium and Cursor. Where scripts from the internet are blocked, as on many company laptops, download the .vsix for your platform from the luwu-latest release and run Extensions: Install from VSIX.... It includes the server.
The extension (luwu-community.luwu) handles .luwu and .luau files. Settings go under luwu.*, and existing luau-lsp.* settings carry over. When both are set, luwu.* wins.
{
"luwu.types.definitionFiles": {
"@seal": "./.seal/typedefs/globals.d.luau"
}
}Zed
Until the extension is on Zed's registry, Zed builds it from source on your machine.
- If
cargoisn't on your PATH, install Rust from rustup.rs. Zed needs it to build the extension. - If you have zed-luau, uninstall it (
zed: extensions, then Luau). - Run the installer and pick Zed. At the end it prints the folder it put the extension in.
- In Zed, open the command palette (Ctrl+Shift+P, or Cmd+Shift+P on macOS), run
zed: install dev extensionand pick that folder.
The first build takes a minute or two. To update, run the installer again and then zed: rebuild dev extension in Zed.
The Luwu extension adds the Luwu and Luau languages, highlighting, snippets and file icons. Settings go under lsp.luwu-lsp.settings, and the luau-lsp object there takes the VS Code extension's luwu.* keys:
{
"lsp": {
"luwu-lsp": {
"settings": {
"definitions": { "@seal": "./.seal/typedefs/globals.d.luau" }
}
}
}
}Limitations
- Until Zed has a Luwu grammar, it highlights with Luau's and colors Luwu's keywords by their text. A variable named
classgets the keyword color, and syntax the grammar can't parse may indent or fold oddly. - Extensions can't hook into editing, so completing
enddoesn't move the cursor back into the block, and there's no tab-out.
Neovim
Install luau-lsp.nvim and point its server.path at luwu-lsp. Neovim doesn't recognize .luwu files yet, so map them to Luau:
vim.filetype.add({ extension = { luwu = "luau" } })
require("luau-lsp").setup({
platform = { type = "standard" },
server = { path = "luwu-lsp" },
})Limitations
- Highlighting uses Luau's grammar, which doesn't know Luwu's syntax. Diagnostics, hovers and completion come from luwu-lsp and do.
- The installer doesn't set up Neovim.
Other editors
Any editor with a Language Server Protocol client can run luwu-lsp. Point its Luau server at the luwu-lsp binary, which takes luau-lsp's arguments (luwu-lsp lsp).
Command line
luwu-lsp also typechecks from the command line:
luwu-lsp analyze --defs=globals.d.luau src/Luau compatibility
Luwu's editor support explicitly wants to improve the experience for Luau and Roblox users. luwu-lsp checks .luau files, and luau-lsp's Roblox support works with luwu.platform.type set to "roblox". Luwu forked from Luau 0.730, so Luau features added since then work only once Luwu supports them.
To check code as plain Luau without Luwu's features, pass --luau-compat or set luwu.luauCompatibilityMode.
Bugs and improvements
Confusing errors and missing editor features matter to us as much as crashes, so please report them.