pub struct ErrorClassifier;Expand description
Perl script error classification engine for LSP workflow operations
Analyzes parsing errors and provides specific error types with recovery suggestions for robust Perl parsing workflows within enterprise LSP environments.
Implementations§
Source§impl ErrorClassifier
impl ErrorClassifier
Sourcepub fn new() -> ErrorClassifier
pub fn new() -> ErrorClassifier
Create new error classifier for Perl script analysis
§Returns
Configured classifier ready for LSP workflow error analysis
Sourcepub fn classify(&self, error_node: &Node, source: &str) -> ParseErrorKind
pub fn classify(&self, error_node: &Node, source: &str) -> ParseErrorKind
Classify parsing error based on AST node and source context
Analyzes error patterns in Perl script content to provide specific error types for targeted recovery strategies during LSP workflow.
§Arguments
error_node- AST node where error occurredsource- Complete Perl script source code for context analysis
§Returns
Specific error type for targeted recovery during Perl parsing
Sourcepub fn get_diagnostic_message(&self, kind: &ParseErrorKind) -> String
pub fn get_diagnostic_message(&self, kind: &ParseErrorKind) -> String
Generate user-friendly diagnostic message for classified error
Converts error classification into readable message for Perl script developers during LSP workflow processing and debugging operations.
§Arguments
kind- Classified error type from Perl script analysis
§Returns
Human-readable error message describing the parsing issue
Sourcepub fn get_suggestion(&self, kind: &ParseErrorKind) -> Option<String>
pub fn get_suggestion(&self, kind: &ParseErrorKind) -> Option<String>
Generate recovery suggestion for classified parsing error
Provides actionable recovery suggestions for Perl script developers to resolve parsing issues during LSP workflow development.
§Arguments
kind- Classified error type requiring recovery suggestion
§Returns
Optional recovery suggestion or None if no specific suggestion available