module

Krikri::Lint::FixSpan

Helpers to locate the exact written text span of a scalar node on its source line, so fixes can rewrite values without re-dumping the YAML (preserving comments, quoting, and everything else).

Instance methods

quote_char(line : String, column : Int32) : Char | Nil

The quote character the scalar is written with, or nil when plain.

Source
scalar_span(line : String, column : Int32) : Tuple(Int32, Int32) | Nil

{start_col0, end_col0_exclusive} of the scalar's written text on its line (quote characters included), or nil for block scalars and anything the span cannot be determined for.

Source