25
let bodyStartLine = 0;
26
if (linesWithEOL[0].match(/^---[\s\r\n]*$/)) {
27
>
let headerEndLine = linesWithEOL.findIndex((line, index) => index > 0 && line.match(/^---[\s\r\n]*$/));
promptFileParser.ts
28
>
if (headerEndLine === -1) {
29
headerEndLine = linesWithEOL.length;
30
bodyStartLine = linesWithEOL.length;
32
>
bodyStartLine = headerEndLine + 1;
33
>
}
34
>
// range starts on the line after the ---, and ends at the beginning of the line that has the closing ---
35
>
const range = new Range(2, 1, headerEndLine + 1, 1);
36
>
header = new PromptHeader(range, uri, linesWithEOL);
37
>
}
38
if (bodyStartLine < linesWithEOL.length) {
39
// range starts on the line after the ---, and ends at the beginning of line after the last line