formatCompilerErrorWithPosition creates a formatted compiler error with specific line/column position. filePath: the file path to include in the error line: the line number where the error occurred column: the column number where the error occurred errType: the error type ("error" or "warning") mes
(filePath string, line int, column int, errType string, message string, cause error)
| 72 | // message: the error message text |
| 73 | // cause: optional underlying error to wrap (use nil for validation errors) |
| 74 | func formatCompilerErrorWithPosition(filePath string, line int, column int, errType string, message string, cause error) error { |
| 75 | compilerErrorLog.Printf("Formatting compiler error: file=%s, line=%d, column=%d, type=%s, message=%s", filePath, line, column, errType, message) |
| 76 | formattedErr := console.FormatError(console.CompilerError{ |
| 77 | Position: console.ErrorPosition{ |
| 78 | File: filePath, |
| 79 | Line: line, |
| 80 | Column: column, |
| 81 | }, |
| 82 | Type: errType, |
| 83 | Message: message, |
| 84 | }) |
| 85 | |
| 86 | // Always return a *wrappedCompilerError so isFormattedCompilerError can detect it. |
| 87 | // cause may be nil for validation errors that have no underlying cause. |
| 88 | return &wrappedCompilerError{formatted: formattedErr, cause: cause} |
| 89 | } |
| 90 | |
| 91 | // formatCompilerErrorWithContext creates a formatted compiler error with specific |
| 92 | // line/column position and source-code context lines for Rust-style rendering. |