| Crates.io | oak-structure |
| lib.rs | oak-structure |
| version | 0.0.1 |
| created_at | 2026-01-23 05:19:30.324489+00 |
| updated_at | 2026-01-23 05:19:30.324489+00 |
| description | AST-based document structure and symbol tree generation for the Oak framework. |
| homepage | |
| repository | https://github.com/ygg-lang/oaks |
| max_upload_size | |
| id | 2063506 |
| size | 18,680 |
Hierarchical document structure and outline provider for the Oak ecosystem.
Oak Structure provides the tools to build a hierarchical representation of a document's logical components. It is used to power "Outline" views, "Breadcrumbs", and "Document Symbols" in modern IDEs, allowing users to quickly see and navigate the structure of their code.
UniversalElementRole for cross-language compatibility.textDocument/documentSymbol.Creating a StructureItem:
use oak_structure::StructureItem;
use oak_core::language::UniversalElementRole;
let item = StructureItem {
name: "main".to_string(),
detail: Some("fn main()".to_string()),
role: UniversalElementRole::Definition,
range: 0..50,
selection_range: 3..7,
deprecated: false,
children: vec![],
};
use oak_structure::{StructureProvider, StructureItem};
use oak_core::tree::RedNode;
use my_language::MyLanguage;
struct MyStructureProvider;
impl StructureProvider<MyLanguage> for MyStructureProvider {
fn structure(&self, root: &RedNode<MyLanguage::ElementType>) -> Vec<StructureItem> {
// Recursively build the structure tree from the AST
vec![]
}
}
Oak Structure is a core component for:
Contributions are welcome! Please feel free to submit issues or pull requests.
Oak Structure - Visualizing the logical architecture of your code 🚀