Contributing
June 26, 2026 ยท View on GitHub
Crates Overview
Our project is organized into several crates:
| Crate | Badge | Description |
|---|---|---|
| ๐ emmylua_parser | The foundational Rust-based Lua parser engineered for maximum efficiency and accuracy. Powers all downstream analysis tools. | |
| ๐ emmylua_parser_desc | Extension for EmmyLua-Parser that handles Markdown/RST highlighting in comments. | |
| ๐ง emmylua_code_analysis | Advanced semantic analysis engine providing deep code understanding, type inference, and cross-reference resolution. | |
| ๐ฅ๏ธ emmylua_ls | The complete Language Server Protocol implementation offering rich IDE features across all major editors. | |
| ๐ emmylua_doc_cli | Professional documentation generator creating beautiful, searchable API docs from your Lua code and annotations. | |
| โ emmylua_check | Comprehensive static analysis tool for code quality assurance, catching bugs before they reach production. | |
| ๐งน emmylua_formatter | The Lua formatter used by the EmmyLua Analyzer Rust workspace. |
Note: We don't accept PRs that change formatting output, but you can report formatting bugs via issues โ I'll verify and fix them myself. This is because most people aren't fully aware of the complexities involved in formatting
Testing
We use the standard Rust testing harness, along with assert macros from googletest-rust:
# Run all tests
cargo test
# Run tests for specific crate
cargo test -p emmylua_parser
If you're unfamiliar with googletest-rust, here's a quick overview:
-
Use
googletest::prelude::*in your test modules, and annotate test functions with#[gtest]. -
assert_that!checks a condition and panics on error:assert_that!(2 * 2, eq(4));Prefer
assert_that!(x, eq(y))toassert_eqbecause the former generates a nice diff for you. -
expect_that!checks a condition, marks test as failed on error, and continues execution.This is useful when adding multiple test cases to a single
#[gtest]function:// Both expectations will be evaluated and reported when test fails: expect_that!(2 * 2, ne(4)); expect_that!(3 * 3, ne(9)); -
verify_that!checks a condition and returns agoogletest::Result. -
OrFail::or_failconverts anyOptionalandResultto agoogletest::Result. It also adds current location to an error message. We have a wrapper around it calledcheck!.
Code style and formatting
We use rustfmt and pre-commit to manage project's code style.
-
rustfmtformats Rust code. Simply runcargo fmt --allto reformat all files. -
pre-commitfixes common issues like trailing whitespaces or broken symlinks in all text files.To run it,
- install
pre-commit, - invoke
pre-commit run --all.
If it suits your workflow, you can configure PreCommit to run before every commit. To do so, run
pre-commit install. Note that this is not required because our CI will detect any issues. - install