Luau Language Server: for external editors

Luau Language Server

An implementation of a language server for the Luau programming language


The Luau Language Server is a fully-featured implementation of the Language Server Protocol for Luau, powered by Open Source Luau.
You can take the full power of Luau from Roblox Studio to any of your external editors, such as VSCode, Sublime Text, Neovim and more!

Luau LSP supports Rojo for external development (using rojo sourcemap). It can also support any other external development mode: it just requires a sourcemap.json to map your Roblox Instance Hierarchy to your filesystem.
Alongside the sourcemap, a Roblox Studio Companion Plugin can be used to infer more of your Instance Hierarchy, if it is not all stored on the filesystem.

Features

  • Complete Luau Diagnostics and Typechecking
  • Rojo (and others) External Development Support
  • Fully typed Roblox API (and Documentation)
  • Autocompletion (including automatic service imports)
  • Hover
  • Signature Help
  • Inlay Hints
  • Semantic Tokens
  • Go To Definition / Go To Type Definition
  • Find References
  • Document Link
  • Document Symbols
  • Rename
  • Code Actions
  • Moonwave Documentation Comments

Standalone Tooling

The Luau Language Server also supports a standalone analyze CLI tool. This means you can perform type checking separately. This can be useful in CI such as GitHub Actions.

You can download the CLI tool from GitHub Releases (with full support for Foreman/Aftman)

Once downloaded, run the tool like so:

luau-lsp analyze --definitions=path/to/globalTypes.d.lua path/to/file.luau

globalTypes.d.lua lists all type definitions loaded into the global scope. You can find an updated version here

How does the Luau Language Server differ from Roblox LSP?

The main difference is that the Luau Language Server is fully powered by open source Luau (GitHub - Roblox/luau: A fast, small, safe, gradually typed embeddable scripting language derived from Lua).

This means that it can take full advantage of the type engine that you find in Roblox Studio, including any future improvements or updates.

Using the Luau type engine, Luau Language Server has better knowledge about the type graph, and this leads to better IntelliSense.

Support

Feel free to reach out on this Topic or open up an Issue / Discussion on GitHub

26 Likes

Great Plugin! This is way better than roblox lsp

1 Like

Does it actually add suggestions for instances like something in workspace?

yes dawg its amazing

its genuinely a super powerful lsp

Im definetly switching back t rojo

How can I run luau code via the LSP?

The language server just performs static code intelligence, but does not execute code.

You might be interested in something like Lune to run Luau code: GitHub - lune-org/lune: A standalone Luau runtime

is there any chance you could add service snippets, like when i type tween I wish there was an auto tweenservice import from game:GetService(‘…’). I know this is a harder ask but could you also do the same thing with module scripts using the sourcemap?
{7C5BF3D8-1F74-4AE7-BE8E-7994F731385A}