Use luau-lsp.nvim for Neovim
mainluau-lsp.nvim plugin is designed to improve the development experience for Luau within Neovim. It acts as a bridge to integrate the luau-lsp language server into your Neovim environment.repository·main·Indexed 19 days ago
https://github.com/johnnymorganz/luau-lspA Language Server implementation for the Luau programming language providing diagnostics, autocompletion, and intellisense. It features deep integration with Roblox development workflows, including Rojo sourcemaps and a Roblox Studio Companion Plugin for real-time DataModel resolution. Supports various editors via LSP, including VS Code, Neovim (luau-lsp.nvim), JetBrains IDEs (intellij-luau), and Zed (zed-luau).
luau-lsp.nvim plugin is designed to improve the development experience for Luau within Neovim. It acts as a bridge to integrate the luau-lsp language server into your Neovim environment.The Roblox platform (the default setting) injects all Roblox global types into your environment. This mode supports instance-based require calls by using a sourcemap to translate file-system paths to Roblox DataModel paths.
local library = require(game.ReplicatedStorage.Library)The language server supports two types of configuration:
.luaurc files to configure language strictness, lints, and require aliases. This follows the standard Luau RFC specification.In Standard mode, the language server only loads built-in Luau globals. This mode follows Luau's require-by-string semantics, meaning you must use file-system paths when requiring modules.
local library = require("../library")TextEdit objects.Multiple Plugins: All configured plugins receive the original source (they are not chained). Edits from all plugins are combined. If edits overlap, an error is logged and no transformation is applied.
The Studio Plugin acts as a bridge between the Roblox DataModel and your external editor.
InstanceTracker module detects changes within the Roblox DataModel.ServerEndpoints.The globalTypes.d.luau file is an autogenerated type definition file used for Roblox development. You can regenerate this file by running the dumpRobloxTypes.py script, which extracts information from the Roblox API Dump, BrickColor data, and DataTypes.json.
$ python dumpRobloxTypes.py > globalTypes.d.luauYou can provide built-in definitions and documentation to the server to improve intellisense.
Use the --definitions:@name=PATH argument to add definition files. The name must be a unique reference. You can provide multiple definitions.
Use the --docs=PATH argument to provide documentation files for built-in definitions.
Recommended URLs for Roblox Users:
https://luau-lsp.pages.dev/type-definitions/globalTypes.None.d.luauhttps://luau-lsp.pages.dev/type-definitions/globalTypes.PluginSecurity.d.luauhttps://luau-lsp.pages.dev/type-definitions/globalTypes.LocalUserSecurity.d.luauhttps://luau-lsp.pages.dev/type-definitions/globalTypes.RobloxScriptSecurity.d.luauhttps://luau-lsp.pages.dev/api-docs/en-us.json$ luau-lsp lsp --definitions:@roblox=/path/to/globalTypes.d.luauYou can add Luau support to JetBrains IDEs (such as IntelliJ IDEA, PyCharm, WebStorm, etc.) by installing the intellij-luau plugin from the JetBrains Marketplace.
https://plugins.jetbrains.com/plugin/24957-luau/editTo enable real-time DataModel information in your external editor (like VS Code), you must install the companion plugin in Roblox Studio and enable it in your editor settings.
luau-lsp extension is installed in your editor (e.g., VS Code).true:luau-lsp.studioPlugin.enabled{
"luau-lsp.studioPlugin.enabled": true
}If you use Rojo (v7.3.0+), the language server uses Rojo-style sourcemaps to resolve DataModel instance trees for intellisense. The server listens for changes to a sourcemap.json file at the workspace root.
To generate the sourcemap, run:
rojo sourcemap --watch default.project.json --output sourcemap.json
It is recommended to add sourcemap.json to your .gitignore.
rojo sourcemap --watch default.project.json --output sourcemap.jsonYou can install the Luau Language Server via the VSCode Marketplace or OpenVSX Registry. For other editors, you can set up your own client following the Language Server Clients guide.
If you need the latest features, you can download a Nightly Release and manually install the .vsix file. Nightly builds include debug symbols and profiling instrumentation.
VSCode Marketplace: https://marketplace.visualstudio.com/items?itemName=JohnnyMorganz.luau-lsp
OpenVSX Registry: https://open-vsx.org/extension/JohnnyMorganz/luau-lsp