Class VisualErrorFormatter

java.lang.Object
org.ek9lang.compiler.common.VisualErrorFormatter

public final class VisualErrorFormatter extends Object
Formats compiler errors in a visual style similar to Rust/Elm compilers. Displays the source code line with underline markers pointing to the error location. Supports colors and Unicode symbols when terminal capabilities are detected.

Example output (with colors/symbols):

❌ error[E02010]: Property/Field duplicated
 ──▶ example.ek9:12:7
    │
 12 │   prop3 <- String()
    │   ^^^^^ property already exists in parent type
    │
    ├─ 💡 Did you mean: 'prop2'?
    └─ 🔗 See: https://ek9.io/errors.html#E02010
  • Method Details

    • format

      public static String format(VisualErrorData data)
      Format an error with visual source display.
      Parameters:
      data - All the error data needed for visual formatting
      Returns:
      The formatted visual error string