| Crates.io | oak-semantic-tokens |
| lib.rs | oak-semantic-tokens |
| version | 0.0.1 |
| created_at | 2026-01-23 05:18:57.875067+00 |
| updated_at | 2026-01-23 05:18:57.875067+00 |
| description | Semantic syntax highlighting and token classification for the Oak framework. |
| homepage | |
| repository | https://github.com/ygg-lang/oaks |
| max_upload_size | |
| id | 2063502 |
| size | 17,940 |
High-performance semantic highlighting engine for the Oak ecosystem, providing precise token classification for IDEs.
Oak Semantic Tokens provides the infrastructure for "Semantic Highlighting" — a technique that goes beyond simple regex-based syntax highlighting by using full AST analysis. It allows editors to distinguish between different types of identifiers (e.g., variables vs. functions vs. types) and apply context-aware colors.
Basic usage of the SemanticToken structure:
use oak_semantic_tokens::SemanticToken;
let token = SemanticToken {
delta_line: 0,
delta_start: 5,
length: 10,
token_type: 1, // e.g., Function
token_modifiers_bitmask: 0,
};
use oak_semantic_tokens::{SemanticTokensProvider, SemanticToken};
use oak_core::tree::RedNode;
use my_language::MyLanguage;
struct MySemanticProvider;
impl SemanticTokensProvider<MyLanguage> for MySemanticProvider {
fn semantic_tokens(&self, root: &RedNode<MyLanguage::ElementType>) -> Vec<SemanticToken> {
let mut tokens = Vec::new();
// Traverse the tree and generate tokens with correct types/modifiers
tokens
}
}
Oak Semantic Tokens is used by:
textDocument/semanticTokens/full and range.Contributions are welcome! Please feel free to submit issues or pull requests.
Oak Semantic Tokens - Precise semantic highlighting for every language 🚀