Lil' Wrapper is a Rust library that hard-wraps comments and prose to a configurable column. It is available as a Rust library, a native Language Server Protocol (LSP) server, and a Zed extension.
| Component | Use it when you want to... |
|---|---|
| Core library | Wrap text from Rust code. |
| LSP server | Integrate wrapping into an editor or LSP client. |
| Zed extension | Configure and use Lil Wrapper in Zed. |
| CLI | Wrap a file from a terminal or script. |
The workspace requires Rust 1.85 or newer. Run the core and LSP tests with:
cargo test --workspace
cargo clippy --workspace --all-targets -- -D warnings
cargo fmt --all -- --checkThe compatibility suite compares this implementation against the original Rewrap, so
cargo test --workspace needs the upstream sources in vendor/rewrap. They are not committed
here. Restore them once, at the pinned commit that the suite verifies byte-for-byte:
git clone --filter=blob:none --no-checkout https://github.com/stkb/Rewrap.git vendor/rewrap
git -C vendor/rewrap checkout --detach 6ba6e3db36686f713e0180f1a5bbefcc9685e144That suite also requires the .NET 8 SDK and Deno 2. Building the Zed
extension requires the wasm32-wasip2 target:
rustup target add wasm32-wasip2
cargo check --package lil-wrapper-zed --target wasm32-wasip2