flake_edit/walk/error.rs
1use rnix::SyntaxKind;
2use thiserror::Error;
3
4/// Errors that can occur during AST walking and manipulation.
5#[derive(Debug, Error)]
6pub enum WalkerError {
7 #[error("Expected root node, found {0:?}")]
8 NotARoot(SyntaxKind),
9
10 #[error("Expected {expected:?}, found {found:?}")]
11 UnexpectedNodeKind {
12 expected: SyntaxKind,
13 found: SyntaxKind,
14 },
15
16 #[error("Feature not yet implemented: {0}")]
17 NotImplemented(String),
18}