Registry / utility / tree-sitter-highlight

tree-sitter-highlight

JSON →
library0.26.3rscratesunverified

Library for performing syntax highlighting using Tree-sitter grammars.

# Cargo.toml [dependencies] tree-sitter-highlight = "0.26.3"
INSTALL
IMPORT
SIG · TREE-SITTER-HIGHLI
T
tree-sitter-highlight
utilityrustv0.26.3
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

HighlightConfiguration
use tree_sitter_highlight::HighlightConfiguration;

Configures syntax highlighting for Rust and highlights a code snippet.

use tree_sitter_highlight::HighlightConfiguration; fn main() -> Result<(), Box<dyn std::error::Error>> { let mut config = HighlightConfiguration::new( tree_sitter_rust::language(), tree_sitter_rust::HIGHLIGHT_QUERY, "", "", )?; let highlights = config.highlight( b"fn main() {}", None, |_| {} )?; Ok(()) }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
0.26.3latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
tree-sitter-highlight — cargo add tree-sitter-highlight · libregistry