A Zed extension that adds support for the Luau scripting language.
To install zed-luau, you can use the extension menu in Zed, or clone the repository and install it
as a dev extension with zed: install dev extension
.
This extension can be configured via your Zed settings.json
. The default configuration looks like
this:
The configuration options for settings.luau-lsp
are shown in the ClientConfiguration
structure
here.
For example, to enable inlay hints, you can add the following to your Zed settings.json
:
{
"inlay_hints": {
"enabled": true
},
"lsp": {
"luau-lsp": {
"settings": {
"luau-lsp": {
"inlayHints": {
"parameterNames": "all"
}
}
}
}
}
}
zed-luau does not provide Rojo support by itself. It's ergonomical to use Zed tasks to run Rojo commands. For example:
[
{
"label": "Serve and autogenerate sourcemap",
"command": "rojo serve & rojo sourcemap --watch --include-non-scripts --output sourcemap.json"
},
{
"label": "Build and open",
"command": "rojo build --output a.rbxl; open a.rbxl"
}
]
To get autocompletion in project.json
files, you can add the following to your Zed settings.json
:
{
"lsp": {
"json-language-server": {
"settings": {
"json": {
"schemas": [
{
"fileMatch": ["*.project.json"],
"url": "https://raw.githubusercontent.com/rojo-rbx/vscode-rojo/refs/heads/master/schemas/project.template.schema.json"
}
]
}
}
}
}
}
To use zed-luau with lune, follow the Editor Setup guide. The editor settings for Zed are as follows:
{
"lsp": {
"luau-lsp": {
"settings": {
"luau-lsp": {
"require": {
"mode": "relativeToFile",
"directoryAliases": {
"@lune/": "~/.lune/.typedefs/x.y.z/"
}
}
}
}
}
}
}
For automatically formatting your code, you can install
StyLua, a Lua code formatter. Then,
use the following settings in your Zed settings.json
:
{
"languages": {
"Luau": {
"formatter": {
"external": {
"command": "stylua",
"arguments": ["-"]
}
}
}
}
}
zed-luau marks expressions of the form
x("", ...)
where x
is it
, describe
, or test
, as runnables with the tag luau-jest-test
, and sets
$ZED_CUSTOM_script
to the contents of the string parameter. This is helpful if you're using
jest-lua or a similar testing framework.
- Bytecode generation (#20042)
- Language-server-assisted end autocomplete