caffeine_lang/source_snippet
Types
A rendered source snippet with line numbers and error markers.
pub type SourceSnippet {
SourceSnippet(rendered: String)
}
Constructors
-
SourceSnippet(rendered: String)
Values
pub fn extract_snippet(
source_content: String,
line: Int,
column: Int,
end_column: option.Option(Int),
) -> SourceSnippet
Extracts a source snippet around the given line/column position. Shows 1 line of context above and below the error line. Adds a caret (^) marker under the error position. Line and column are 1-indexed.