Skip to main content

Module parse_error

Module parse_error 

Source
Expand description

Structured parse error types for Shape

These types represent parse errors as structured data rather than strings, enabling different rendering for CLI vs LSP contexts.

Structs§

Highlight
A highlight/underline on a source line
RelatedInfo
Related information (e.g., “unclosed brace opened here”)
SourceContext
Source context for rendering
SourceLine
A single source line with metadata
StructuredParseError
A complete structured parse error with all context needed for rendering
Suggestion
A suggestion for fixing the error
TextEdit
Text edit for auto-fix
TokenInfo
Information about a found token

Enums§

ErrorSeverity
Error severity levels
ExpectedToken
What token/construct was expected
HighlightStyle
IdentifierContext
Context where an identifier was expected
MissingComponentKind
What component is missing
NumberError
Why a number is invalid
ParseErrorKind
Specific parse error variants with structured context
StringDelimiter
String delimiter types
SuggestionConfidence
TokenCategory
Categories of expected tokens for grouping
TokenKind
Token kinds for better error messages

Functions§

format_error_message
Format the main error message based on error kind (plain text, no colors)
matching_close
Get the matching closing delimiter
rule_to_friendly_name
Convert pest Rule names to user-friendly descriptions