We welcome your feedback and contributions. Please feel free to submit pull requests (PRs) and report issues to help shape the project's direction.
Crate | Badge | Description |
---|---|---|
emmylua_parser | A Rust-based Lua parser built for efficiency and accuracy. It serves as the foundation for advanced code analysis and the language server. | |
emmylua_code_analysis | Provides Lua code analysis by leveraging emmylua_parser. | |
emmylua_ls | The language server for Lua, offering extensive features for different Lua versions. | |
emmylua_doc_cli | A command-line tool to effortlessly generate Lua API documentation. | |
emmylua_check | A tool to perform static analysis and validate Lua code quality. |
- Support for Lua 5.1, 5.2, 5.3, 5.4, and LuaJIT.
- Support Luacats/emmylua annotations.
- Support almost lsp features.
if you want to install emmylua_ls and emmylua_doc_cli, you can use the following command:
# install emmylua_ls
cargo install emmylua_ls
# install emmylua_doc_cli
cargo install emmylua_doc_cli
# install emmylua_check
cargo install emmylua_check
if you are using vscode, you can install the vscode extension EmmyLua to get a better experience.
If you have installed emmylua_ls using cargo install, you can simply run emmylua_ls to start the language server without any additional parameters.
If you have installed emmylua_doc_cli using cargo install, you can simply run emmylua_doc_cli to generate documentation. You can use the --input parameter to specify the directory of Lua files and the --output parameter to specify the output directory for the generated documentation.
emmylua_doc_cli --input ./tests/lua --output ./tests/doc
If you have installed emmylua_check using cargo install, you can simply run emmylua_check to check Lua code.
emmylua_check <workspace>
cargo build --release -p emmylua_ls
The language server supports both stdio and TCP communication, with stdio communication as the default. It has several startup parameters:
-c
specifies the communication method. Acceptable values arestdio
andtcp
, with the default beingstdio
.--port
When the-c
parameter is set totcp
, the--port
parameter can specify the port number, with the default value of5007
.--log-level
specifies the log level. Acceptable values aredebug
,info
,warn
,error
, with the default beinginfo
.--log-path
specifies the directory path for the log files.
For example:
emmylua_ls -c tcp --port 5007 --log-level debug
# Without parameters, it uses stdio communication
emmylua_ls