| Crates.io | oaks |
| lib.rs | oaks |
| version | 0.0.1 |
| created_at | 2025-10-22 11:33:24.345566+00 |
| updated_at | 2026-01-23 05:38:36.338802+00 |
| description | Unified parser combinator library and IDE feature facade. |
| homepage | |
| repository | |
| max_upload_size | |
| id | 1895515 |
| size | 88,826 |
A unified, language-agnostic framework for building modern IDE features, compilers, and language tools in Rust.
oaks is a high-level facade and orchestration layer for the entire Oak ecosystem. It provides a decoupled, trait-based architecture for building common editor features like hovers, folding, navigation, and semantic highlighting. Inspired by IntelliJ's PSI and the Language Server Protocol (LSP), Oaks makes it easy to add advanced IDE support to any programming language.
The Oak ecosystem consists of several specialized libraries:
LanguageService traits.To build a language service using Oaks:
use oaks::{MemoryVfs, LanguageServiceBuilder};
use oak_rust::RustService; // Example language implementation
#[tokio::main]
async fn main() {
// 1. Initialize Virtual File System
let vfs = MemoryVfs::new();
vfs.write_file("file:///main.rs", "fn main() { }".to_string());
// 2. Build the Language Service
let service = LanguageServiceBuilder::new(Arc::new(vfs))
.with_hover(MyHoverProvider::new())
.with_folding(MyFoldingProvider::new())
.build();
// 3. Use the service
let hover = service.hover("file:///main.rs", Position::new(0, 5)).await;
}
Oaks is designed to be completely independent of any specific programming language. By implementing the Language trait from oak-core, you can plug any language into the Oaks ecosystem.
The Vfs trait provides a unified way to access source code, whether it's stored on disk, in memory, or provided by a remote client. This allows Oaks features to work consistently across different environments.
Each IDE feature (hover, folding, etc.) is defined as a separate trait. This allows you to implement features incrementally and mix-and-match them as needed.
Oaks provides first-class support for the Language Server Protocol. You can easily convert an Oaks LanguageService into a full-featured LSP server using oak-lsp.
use oak_lsp::LspServer;
let lsp_server = LspServer::new(my_oaks_service);
lsp_server.run().await?;
Contributions are welcome! Please feel free to submit issues or pull requests.
Oaks - Empowering the next generation of language tools 🚀