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

35 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

the roblox plugin does not watch when you rename an instance, a common workflow is to add an instance and then rename it. the luau lsp intellisense will only have the instance with the wrong name in it when used in vscode


it also apparently can’t read ypcalls, it’s just missing a couple of deprecated stuff

Why are you using deprecated stuff?

你将永远被锁在黑暗深渊的深门里,一无所有,没有人可以坚持,所以现在是被放逐的时候了,祈祷吧

When i try connecting with the roblox studio plugin it deosnt work and says theres an error with http connection.

ypcall is supported by Luau. From what it looks like, you forgot to setup your Workspace / forgot Selene. Are you using VSCode?

Make sure you give the plugin HTTP permissions in the Manage Plugins menu.

It does have http requests enabled. just for the port that its using witch does match the one used in my vscode’s luau lsp settings.