of

fun of(content: String, startLine: Int, endLine: Int): FileSystemEntry.File.Content(source)

Creates file content from a line range.

Return

Text if range covers the entire file, otherwise Excerpt with single snippet

Parameters

content

file text to extract from

startLine

first line to include (0-based, inclusive)

endLine

first line to exclude (0-based, exclusive) or -1 for the end of the file

Throws

if startLine < 0, endLine < -1, or endLine <= startLine when endLine != -1