_jsonContextWindow

private fnstring _jsonContextWindow(const(char)[] src, size_t index, size_t context = 30) @safe

Build a context window for diagnostics.

The returned string contains a single-line excerpt (roughly context characters to each side) and a caret line highlighting index.

Parameters

srcThe source input buffer.
indexThe 0-based byte offset to highlight.
contextNumber of characters to show on each side of the error position.

Returns

A string containing the source excerpt and a caret line.