Contributing to Codebook
May 19, 2026 ยท View on GitHub
Thanks for your interest in improving Codebook! This document covers the most common contribution paths: adding dictionaries, adding programming language support, running the test suite, and cutting a release.
Running Tests
Run tests with make test after cloning. Integration tests are also available with make integration_test, but requires BunJS to run.
Adding a New Dictionary
Dictionaries in Codebook are currently hardcoded in the dictionary repository file at crates/codebook/src/dictionaries/repo.rs.
To add a new Hunspell-compatible dictionary:
-
Open
crates/codebook/src/dictionaries/repo.rs -
Locate the
HUNSPELL_DICTIONARIESstatic vector (for Hunspell dictionaries) orTEXT_DICTIONARIES(for plain text word lists) -
Add a new entry using the appropriate constructor. For Hunspell dictionaries:
HunspellRepo::new( "nl_nl", // Dictionary name in snake_case "https://raw.githubusercontent.com/wooorm/dictionaries/refs/heads/main/dictionaries/nl/index.aff", "https://raw.githubusercontent.com/wooorm/dictionaries/refs/heads/main/dictionaries/nl/index.dic", ), -
Follow the naming convention:
- Use
snake_caseformat (e.g.,en_us,nl_nl,pt_br) - Language codes should be lowercase
- Names must be unique across all dictionaries
- Use
-
Find dictionary sources:
- wooorm/dictionaries - Large collection of Hunspell dictionaries
- streetsidesoftware/cspell-dicts - CSpell dictionary collection
- Both
.aff(affix rules) and.dic(word list) files are required for Hunspell dictionaries
-
(Optional) Run the tests to verify your addition:
cargo test test_dictionary_names_unique_and_snake_caseThis test ensures dictionary names are unique and follow the snake_case convention.
For plain text dictionaries, use TextRepo::new() instead and add to TEXT_DICTIONARIES.
Adding New Programming Language Support
See the query development guide for instructions on adding Tree-sitter queries for new languages, the tag naming convention, and tips for writing effective queries.
Release
To publish a new version:
- Update and commit changelog with new version number
- Run
make release-lsp - Follow instructions
- Wait for Actions to finish
- Go to GitHub Releases
- Un-mark "prerelease" and publish
- Run
make publish_cratesto upload to crates.io