Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions crates/plotnik-lib/src/diagnostics/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ pub enum DiagnosticKind {
UnknownField,
FieldNotOnNodeType,
InvalidFieldChildType,
InvalidChildType,

// Often consequences of earlier errors
UnnamedDefNotLast,
Expand Down Expand Up @@ -168,6 +169,7 @@ impl DiagnosticKind {
Self::UnknownField => "unknown field",
Self::FieldNotOnNodeType => "field not valid on this node type",
Self::InvalidFieldChildType => "node type not valid for this field",
Self::InvalidChildType => "node type not valid as child",

// Structural
Self::UnnamedDefNotLast => "only the last definition can be unnamed",
Expand All @@ -194,6 +196,7 @@ impl DiagnosticKind {
Self::UnknownField => "`{}` is not a valid field".to_string(),
Self::FieldNotOnNodeType => "field `{}` is not valid on this node type".to_string(),
Self::InvalidFieldChildType => "node type `{}` is not valid for this field".to_string(),
Self::InvalidChildType => "`{}` cannot be a child of this node".to_string(),

// Recursion with cycle path
Self::RecursionNoEscape => "infinite recursion: {}".to_string(),
Expand Down
Loading