:lang lua

One-based indices? one-based indices

1. Description

Adds Lua support to Emacs.

  • REPL
  • Love2D specific functions
  • Moonscript support

1.1. Maintainers

This module has no dedicated maintainers. Become a maintainer?

1.2. Module flags

+fennel
Enable Fennel language support.
+lsp
Enable LSP support. Requires :tools lsp and a langserver.
+moonscript
Enable Moonscript language support.

1.4. Hacks

No hacks documented for this module.

2. Prerequisites

2.1. Language Server Protocol servers

LSP server support depends on which flavor of the :tools lsp module you have installed (Eglot or LSP-mode).

2.1.1. LSP-mode

Three servers are supported, ordered from highest to lowest priority:

EmmyLua-LanguageServer
Must be in ~/.emacs.d/.local/etc/lsp/EmmyLua-LS-all.jar. See lsp-clients-emmy-lua-jar-path variable to change this.
Sumneko language server (lua-language-server)
Must be in ~/.config/emacs/.local/etc/lsp/lua-language-server/. See lsp-clients-lua-language-server-bin variable to change this.
lua-lsp
Must be available in ~/.luarocks/bin/lua-lsp. See lsp-clients-lua-lsp-server-install-dir variable to change this.

LSP-mode documentation has more information about setting up the server and the configuration variables correctly.

2.1.2. Eglot

Eglot currently only supports one of the above servers out of the box:

Sumneko language server (lua-language-server)
Must be in ~/.config/emacs/.local/etc/lsp/lua-language-server/. See +lua-lsp-dir variable to change this.

3. TODO Usage

This module has no usage documentation yet. Write some?

4. TODO Configuration

This module’s configuration documentation is incomplete. Complete it?

lua-lsp-dir
This must be set when using +lsp and using lua-language-server. This controls where the repository has been cloned and built to finish the configuration of the server.

5. Troubleshooting

5.1. Install lua-language-server

A catch-all issue has been created to gather help for installing lua-language-server on non-VSCode platforms.

6. TODO Appendix

This module has no appendix yet. Write one?