Lua Language Server
The Lua Language Server uses the Language Server Protocol to provide various features for Lua in your favourite code editors , making development easier, safer, and faster!
It's time that Lua gets proper support in your editor!
Features
25 annotations to mark parameters, returns, classes, and more!
A type system fit for Lua that helps improve safety and catch type errors in development.
Provides warnings and errors for syntax mistakes, type errors, and more.
Offers completion options while you program to speed things up.
Hover signatures in your code to receive detailed information about them.
Currently available in English, Chinese, Taiwanese, Portuguese. Help translate!
Make your own or use one of the many community-provided defintion files for popular libraries and APIs.
Provides a built-in formatter for ensuring a consistent code-style across your workspace.
Use plugins to add custom functionality to the language server.
Generate documentation in Markdown and JSON formats from your codebase.
Install for...
Visual Studio Code
Install the sumneko.lua extension to get up and running as fast as possible!
- Search for "Lua" by sumneko in the extension marketplace.
- Download and install the extension.
- That's it! It's that easy! Happy Coding!
Neovim
-
Install lua-language-server
-
From package manager
-
Scoop:
scoop install lua-language-server
-
Homebrew:
brew install lua-language-server
-
Macports:
sudo port install lua-language-server
-
Scoop:
- From latest release
- Build from scratch
-
From package manager
-
Ensure that the
lua-language-server
is executable from the command line. It may need to be added to$PATH
. -
In your Neovim configuration file, add the following:
Lua
require'lspconfig'.lua_ls.setup{}
- See the Neovim documentation for more
JetBrains
Install the SumnekoLua plugin from the JetBrains Marketplace!
See JetBrains docs for instructions on installing plugins.
Other
The language server can also just be run from the command line, allowing it to be used wherever the Language Server Protocol is supported!
-
Install lua-language-server
-
From package manager
-
Scoop:
scoop install lua-language-server
-
Homebrew:
brew install lua-language-server
-
Macports:
sudo port install lua-language-server
-
Scoop:
- From latest release
- Build from scratch
-
From package manager
-
Run
./bin/lua-language-server
and check out the supported arguments.
If you plan to use a symbolic link to point to the language server, you will want to instead use a wrapper script like the one below. This is required because the language server expects to find files in the current working directory.
#!/bin/bash
exec "<path-to-directory>/bin/lua-language-server" "$@"
Next Steps
Check out the wiki to learn more about the language server.
Wiki