miette-arborium
Arborium-powered syntax highlighter for miette diagnostics.
This crate integrates arborium's tree-sitter based syntax highlighting into miette's error reporting output, giving your diagnostic messages beautiful, accurate syntax highlighting across 90+ programming languages.
Quick Start
Install the highlighter globally and miette will automatically use it:
Or use it directly with a GraphicalReportHandler:
use ;
use MietteHighlighter;
let handler = new_themed
.with_syntax_highlighting
.with_context_lines;
Features
- Language detection: Automatically detects language from file extension
- 90+ languages: Supports all languages enabled via Cargo features (passthrough to arborium)
- Tree-sitter powered: Accurate syntax highlighting using tree-sitter grammars
- ANSI terminal output: Beautiful colors in your terminal
Language Features
By default, no languages are included. Enable the languages you need via Cargo features:
[]
= { = "0.700", = ["lang-rust", "lang-python", "lang-javascript"] }
Or enable all languages:
[]
= { = "0.700", = ["all-languages"] }
Available Language Features
All lang-* features are passthrough to arborium. Some commonly used ones:
lang-rust- Rustlang-python- Pythonlang-javascript- JavaScriptlang-typescript- TypeScriptlang-go- Golang-c/lang-cpp- C/C++lang-json/lang-yaml/lang-toml- Data formatslang-bash- Shell scriptslang-sql- SQL
See arborium's documentation for the full list of supported languages.
Example
use ;
use Error;
License
Licensed under either of Apache License, Version 2.0 or MIT license at your option.