module

Hecr::LSP::Heredocs

Extracts <<-'HECR' heredoc templates from Crystal sources, dedented and padded with blank lines so parse errors carry file-absolute LINE numbers. margin is the stripped indentation (file column = template column + margin size, for single-byte margins).

Constants

DELIMITER = "HECR"
OPENER = "<<-'HECR'"

Instance methods

containing(source : String, line : Int32) : Extracted | Nil

The extracted template containing the given 0-based line, if any.

Source
extract(source : String) : Array(Extracted)
Source

Nested types