Skip to main content

rouge_syntax/
error.rs

1use thiserror::Error;
2use tree_sitter::LanguageError;
3
4#[derive(Debug, Error)]
5pub enum SyntaxError {
6    #[error("syntax input requires {attempted} bytes, exceeding the {limit}-byte limit")]
7    InputLimit { limit: usize, attempted: usize },
8    #[error("missing syntax grammar: {language}")]
9    MissingGrammar { language: String },
10    #[error("failed to configure the syntax parser: {0}")]
11    Language(#[from] LanguageError),
12    #[error("syntax parser returned no tree")]
13    NoTree,
14}