lua-language-server
Language Server Protocol implementation for Lua
TLDR
SYNOPSIS
lua-language-server [options]
DESCRIPTION
lua-language-server is the Lua Language Server from the LuaLS project. Editors that speak the Language Server Protocol start it and use it for diagnostics, completion, hover, navigation, and formatting of Lua. With no mode flag it serves JSON-RPC on stdin and stdout. --socket serves the same protocol on a TCP port instead.--check is the batch mode: it loads a workspace, runs the same diagnosis the editor would show, and prints or writes the result. --doc exports documentation from annotations in that workspace. --version and --help exit without starting the server.The process is normally installed as the lua-language-server executable (a small launcher plus the Lua scripts and a bundled Lua runtime). The option parser accepts a bare flag or --name=value.
PARAMETERS
--check path
Run a diagnosis of that workspace and write the results to the log directory. The default minimum level is Warning.--checklevel Error|Warning|Information|Hint
With --check, drop diagnostics below this level. Priority from highest to lowest is Error, Warning, Information, Hint. Default Warning.--check_format pretty|json
How --check reports results. pretty prints a readable report on stdout. json writes a JSON file. Default pretty.--check_out_path path
File that receives the JSON diagnosis. Used when --check_format is json. If omitted, the server writes check.json under the log directory.--doc path
Generate documentation from that workspace.--doc_out_path path
Directory for files produced by --doc. If omitted, documentation is written in the current directory.--doc_update path
Update documentation files that already exist at this path.--logpath path
Directory for log files. Default ./log.--loglevel error|warn|info|debug|trace
Minimum level written to the log. trace is the most verbose.--metapath path
Where generated standard-library definition files are written. Default ./meta.--locale name
Interface language. Default en-us. Other names are the directories under the server's locale folder, for example zh-cn.--configpath path
Configuration file to load, relative to the workspace or absolute. When this is set, configuration coming from the editor is not loaded.--socket port
Speak LSP over this TCP port instead of stdin and stdout.--develop
Development mode. Plugins may write into the log directory.--version
Print the version and exit.--help
Print the built-in option list and exit.
CONFIGURATION
Editor clients send settings over LSP. On the command line, --configpath points at one configuration file and disables settings that would have come from the editor. --locale selects the language of server messages. --logpath and --loglevel control the log written at startup; the default log file is service.log inside the log directory. --metapath is where the server writes the standard-library definition files it generates.
INSTALL
CAVEATS
--check needs a real workspace path. A diagnosis of a huge tree can take a long time and writes under --logpath.--check_format=json is for tools. Human-readable output is the pretty format.The server is a language tool, not a Lua interpreter. Running scripts is still lua or luajit.--help lists --force-accept-workspace. The argument parser takes only letters, digits, and underscores as the option name, so that hyphenated word is not read as one option. Pass options as --name or --name=value.
