pub enum TSParseError {
Language(LanguageError),
TreeUnavailable,
}Expand description
Errors that can occur during tree-sitter parsing operations.
Tree-sitter parsing can fail for several reasons, from language compatibility issues to timeout problems. These errors provide information about what went wrong during the parsing process.
Variants§
Language(LanguageError)
The language grammar is incompatible with the parser.
Occurs when trying to assign a language that the parser can’t handle, typically due to version mismatches between the tree-sitter library and the language grammar.
Tree-sitter failed to parse the input within the configured constraints.
Can be caused by several conditions:
- Parsing timeout exceeded (see
Parser::set_timeout_micros) - Cancellation flag was triggered (see
Parser::set_cancellation_flag) - No language was assigned to the parser (see
Parser::set_language) - The input was too complex or malformed for the parser to handle
Tree-sitter doesn’t provide detailed error information, so this covers all general parsing failures.
Trait Implementations§
Source§impl Debug for TSParseError
impl Debug for TSParseError
Source§impl Display for TSParseError
impl Display for TSParseError
Source§impl Error for TSParseError
impl Error for TSParseError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl From<LanguageError> for TSParseError
impl From<LanguageError> for TSParseError
Source§fn from(source: LanguageError) -> Self
fn from(source: LanguageError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for TSParseError
impl RefUnwindSafe for TSParseError
impl Send for TSParseError
impl Sync for TSParseError
impl Unpin for TSParseError
impl UnsafeUnpin for TSParseError
impl UnwindSafe for TSParseError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more