Skip to content

Contributing

  • Rust 1.85+ (rustup update stable)
  • A language server for testing (optional):
    • TypeScript: npm install -g @vtsls/language-server
    • Rust: rustup component add rust-analyzer
    • Go: go install golang.org/x/tools/gopls@latest
Terminal window
git clone https://github.com/Codestz/krait
cd krait
cargo build
Terminal window
cargo test

Runs 299+ unit tests and basic CLI smoke tests.

Terminal window
# Requires rust-analyzer
cargo test -- --ignored

These use fixture projects in tests/fixtures/.

Terminal window
cargo clippy # must pass with zero warnings
  • anyhow for errors in binary/daemon code
  • thiserror for library-level error types
  • No .unwrap() in library code
Terminal window
cargo fmt

Open a pull request directly.

  1. Open an issue first to discuss the approach
  2. Reference the issue in your PR
  3. Include tests for new behavior
  • cargo fmt — no formatting diff
  • cargo clippy — zero warnings
  • cargo test — all tests pass
  • New behavior has unit tests
  • PR description explains the motivation

Krait has three layers:

CLI (src/main.rs, src/cli.rs, src/client.rs) Parses arguments, connects to daemon over Unix socket, prints results. Stateless.

Daemon (src/daemon/) One process per project root. Manages LSP lifecycles, serves requests, maintains the symbol index.

LSP layer (src/lsp/) LspMultiplexer runs one server per language, dynamically attaches workspace folders.

Use GitHub Issues. Include:

  • krait version (krait --version)
  • OS and architecture
  • Minimal reproduction steps
  • Output with RUST_LOG=debug krait <command> for LSP issues