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
- Related
Info - Related information (e.g., “unclosed brace opened here”)
- Source
Context - Source context for rendering
- Source
Line - A single source line with metadata
- Structured
Parse Error - A complete structured parse error with all context needed for rendering
- Suggestion
- A suggestion for fixing the error
- Text
Edit - Text edit for auto-fix
- Token
Info - Information about a found token
Enums§
- Error
Severity - Error severity levels
- Expected
Token - What token/construct was expected
- Highlight
Style - Identifier
Context - Context where an identifier was expected
- Missing
Component Kind - What component is missing
- Number
Error - Why a number is invalid
- Parse
Error Kind - Specific parse error variants with structured context
- String
Delimiter - String delimiter types
- Suggestion
Confidence - Token
Category - Categories of expected tokens for grouping
- Token
Kind - 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