eglot-luau is an Emacs package that adds support for the Luau Lanuage Server to eglot.
eglot-luau provides the following customizable variables:
-
eglot-luau-rojo-sourcemap-enabled:booleanThis variable determines whether eglot-luau will start a Rojo process to generate sourecemaps for the language server. The value of this variable is
nilby default. -
eglot-luau-rojo-sourcemap-includes-non-scripts:booleanThis variable determines whether non-script instances are present in the Rojo sourcemap. The value of this variable is
nilby default. -
eglot-luau-auto-update-roblox-types:booleanThis variable determines whether
eglot-luau-setupwill attempt to download the latest Roblox type definitions. The value of this variable isnilby default. -
eglot-luau-auto-update-roblox-docs:booleanThis variable determines whether
eglot-luau-setupwill attempt to download the latest Roblox docs. The value of this variable isnilby default. -
eglot-luau-roblox-security-level:stringThis variable determines the security level of type definitions downloaded when
eglot-luau-lsp-auto-update-roblox-typesis non-nil. The available options areNone,LocalUserSecurity,PluginSecurity, andRobloxScriptSecurity. The value of this variable isPluginSecurityby default. -
eglot-luau-rojo-project-path:stringThis variable determines the path passed to Rojo for sourcemap generation. The value of this variable is
default.project.jsonby default. -
eglot-luau-fflags-enabled:booleanThis variable determines whether the language server will have any FFlags enabled. The value of this variable is
tby default. -
eglot-luau-fflag-overrides:alistThis variable allows overriding FFlags. It is an alist mapping the names of FFlags to their desired values. An example value is ``(("LuauNonStrictByDefaultBetaFeature" "False"))`. The value of this variable is the empty list by default.
-
eglot-luau-sync-fflags:booleanThis variable determines whether
eglot-luau-setupwill attempt to download the latest Roblox FFlag configuration. The value of this variable istby default. -
eglot-luau-custom-type-files:listThis variable is a list of paths to custom type definition files to supply to the language server. The value of this variable is the empty list by default.
-
eglot-luau-custom-doc-files:listThis variable is a list of paths to custom doc files to supply to the language server. The value of this variable is the empty list by default.
-
eglot-luau-server-executable:stringThis variable determines how to locate the language server. The value of this variable is
luau-lspby default (i.e. it assumes luau-lsp is on the PATH environment variable).
eglot-luau is also configurable using LSP's "workspace configuration," as described in the Eglot documentation.
The entry point to the package is the function eglot-luau-setup. This function should be called after eglot is loaded, but before eglot is invoked, once per major mode you intend to use eglot-luau. A good time to do this is in major mode hooks. It takes one argument: the symbol of the mode for which to setup eglot-luau.
Below is a example configuration using use-package:
(use-package eglot-luau
:autoload (eglot-luau-setup)
:custom
(eglot-luau-rojo-sourcemap-enabled t)
(eglot-luau-rojo-sourcemap-includes-non-scripts t)
(eglot-luau-auto-update-roblox-docs t)
(eglot-luau-auto-update-roblox-types t)
(eglot-luau-fflag-overrides '(("LuauSolverV2" "True")))
:hook
(lua-mode . (lambda () (eglot-luau-setup 'lua-mode)))
(lua-mode . eglot-ensure))end completion does not work. This seems to be caused by a deeper issue in eglot that causes \n to be unusable as a trigger character. Since luau-lsp is hardcoded to use \n as a trigger character for end completion, this is not very straightforward to fix.
Additionally, eglot-luau does not support bytecode generation, not does it support luau-lsp's Roblox Studio companion plugin.