475
const linkMatch = line.matchAll(/\[(.*?)\]\((.+?)\)/g);
476
for (const match of linkMatch) {
478
continue; // skip image links
479
}
481
continue; // skip matches inside inline code
482
}
483
>
const linkEndOffset = match.index + match[0].length - 1; // before the parenthesis
promptFileParser.ts
484
>
const linkStartOffset = match.index + match[0].length - match[2].length - 1;
485
>
const range = new Range(i + 1, linkStartOffset + 1, i + 1, linkEndOffset + 1);
486
>
fileReferences.push({ content: match[2], range, isMarkdownLink: true });
487
>
markdownLinkRanges.push(new Range(i + 1, match.index + 1, i + 1, match.index + match[0].length + 1));
488
>
}
489
// Match #file:<filePath> and #tool:<toolName>
490
// Regarding the <toolName> pattern below, see also the variableReg regex in chatRequestParser.ts.