Lua Language Server

1.4M Visual Studio Code installs 3K+

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

Powerful Annotations

25 annotations to mark parameters, returns, classes, and more!

Dynamic Type System

A type system fit for Lua that helps improve safety and catch type errors in development.

Diagnostics

Provides warnings and errors for syntax mistakes, type errors, and more.

Autocompletion

Offers completion options while you program to speed things up.

Hover for Details

Hover signatures in your code to receive detailed information about them.

Localization Support

Currently available in English, Chinese, Taiwanese, Portuguese. Help translate!

Supports Definition Files

Make your own or use one of the many community-provided defintion files for popular libraries and APIs.

Built-in Formatting

Provides a built-in formatter for ensuring a consistent code-style across your workspace.

Custom Plugins

Use plugins to add custom functionality to the language server.

Documentation Generation

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!

  1. Search for "Lua" by sumneko in the extension marketplace.
  2. Download and install the extension.
  3. That's it! It's that easy! Happy Coding!

Neovim

  1. Install lua-language-server
    1. From package manager
      • Scoop: scoop install lua-language-server
      • Homebrew: brew install lua-language-server
      • Macports: sudo port install lua-language-server
    2. From latest release
    3. Build from scratch
  2. Ensure that the lua-language-server is executable from the command line. It may need to be added to $PATH.
  3. In your Neovim configuration file, add the following:
    Lua
    require'lspconfig'.lua_ls.setup{}
  4. 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!

  1. Install lua-language-server
    1. From package manager
      • Scoop: scoop install lua-language-server
      • Homebrew: brew install lua-language-server
      • Macports: sudo port install lua-language-server
    2. From latest release
    3. Build from scratch
  2. Run ./bin/lua-language-server and check out the supported arguments.
Note

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.

bash
#!/bin/bash
exec "<path-to-directory>/bin/lua-language-server" "$@"

Next Steps

Check out the wiki to learn more about the language server.

Wiki