2020-06-03 14:57:00 +02:00
#+TITLE : lang/lua
#+DATE : Jun 3, 2020
#+SINCE : v3.0
#+STARTUP : inlineimages nofold
* Table of Contents :TOC_3:noexport:
- [[#description ][Description ]]
- [[#maintainers ][Maintainers ]]
- [[#module-flags ][Module Flags ]]
- [[#plugins ][Plugins ]]
- [[#prerequisites ][Prerequisites ]]
- [[#language-server-protocol-servers ][Language Server Protocol servers ]]
- [[#lsp-mode ][LSP-mode ]]
- [[#eglot ][Eglot ]]
- [[#features ][Features ]]
- [[#configuration ][Configuration ]]
- [[#troubleshooting ][Troubleshooting ]]
- [[#install-lua-language-server ][Install lua-language-server ]]
* Description
Adds Lua support to Doom Emacs
# A summary of what this module does.
+ REPL
+ Love2D specific functions
+ Moonscript support
** Maintainers
This module has no dedicated maintainers.
** Module Flags
+ =+moonscript= Moonscript language support
2021-06-21 12:26:30 +03:00
+ =+fennel= Fennel language support
2020-06-03 14:57:00 +02:00
+ =+lsp= Language Server Protocol support
** Plugins
# A list of linked plugins
+ [[https://github.com/immerrr/lua-mode ][lua-mode ]]
+ [[https://github.com/k2052/moonscript-mode ][moonscript-mode ]] (=+moonscript= )
2021-06-21 12:26:30 +03:00
+ [[https://gitlab.com/technomancy/fennel-mode ][fennel-mode ]] (=+fennel= )
2020-06-03 14:57:00 +02:00
* Prerequisites
** Language Server Protocol servers
2021-01-03 17:07:22 -05:00
LSP server support depends on which flavor of the =:tools lsp= module you have
installed (Eglot or LSP-mode).
2020-06-03 14:57:00 +02:00
*** LSP-mode
2021-01-03 17:07:22 -05:00
Three servers are supported, ordered from highest to lowest priority:
+ [[https://github.com/EmmyLua/EmmyLua-LanguageServer][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.
+ [[https://github.com/sumneko/lua-language-server ][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.
+ [[https://github.com/Alloyed/lua-lsp][lua-lsp]] :: Must be available in =~/.luarocks/bin/lua-lsp= . See
~lsp-clients-lua-lsp-server-install-dir~ variable to change this.
2020-06-03 14:57:00 +02:00
[[https://emacs-lsp.github.io/lsp-mode/page/lsp-emmy-lua/ ][LSP-mode documentation ]] has more information about setting up the server and the
2021-01-03 17:07:22 -05:00
configuration variables correctly.
2020-06-03 14:57:00 +02:00
*** Eglot
2021-01-03 17:07:22 -05:00
Eglot currently only supports one of the above servers out of the box:
+ [[https://github.com/sumneko/lua-language-server ][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.
2020-06-03 14:57:00 +02:00
* TODO Features
# An in-depth list of features, how to use them, and their dependencies.
* Configuration
- lua-lsp-dir :: This must be set when using =+lsp= and using
[[https://github.com/sumneko/lua-language-server ][lua-language-server ]]. This controls where the repository has been cloned and
built to finish the configuration of the server.
* Troubleshooting
** Install lua-language-server
A [[https://github.com/sumneko/lua-language-server/issues/60 ][catch-all issue ]] has been created to gather help for installing
lua-language-server on non-VSCode platforms.