7 releases
Uses new Rust 2024
| new 0.0.6 | Mar 4, 2026 |
|---|---|
| 0.0.5 | Mar 3, 2026 |
| 0.0.4 | Feb 15, 2026 |
| 0.0.2 | Jan 30, 2026 |
| 0.0.0 | Oct 20, 2025 |
#837 in Text processing
1,097 downloads per month
Used in 128 crates
(126 directly)
340KB
5.5K
SLoC
🚀 oak-pretty-print
Code Formatting and Pretty Printing for Oak — Lossless code formatting infrastructure for Oak language parsers.
🎯 Why oak-pretty-print?
Code formatting is essential for readability and consistency. oak-pretty-print provides the infrastructure for implementing formatters that preserve all source details while applying consistent formatting rules.
✨ Key Features
- 📝 Lossless Formatting — Preserves all source details including comments and trivia
- 🌳 Tree-Based — Works directly with Oak's syntax trees for accuracy
- 🔧 Configurable — Support for different formatting styles and options
- ⚡ Incremental — Efficient re-formatting of changed sections only
- 🧩 Language Agnostic — Works with any Oak language parser
🏗️ Architecture
Operates on the Green/Red tree structure via trivia manipulation, rule-based formatting, and lossless round-trip processing.
🔗 Ecosystem Integration
Integrates with oak-lsp for textDocument/formatting, language-specific formatters, and code style enforcement tools.
📖 Documentation
For usage examples and API details, see the API documentation.
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Dependencies
~5.5–8MB
~73K SLoC