492
const matches = line.matchAll(reg);
493
for (const match of matches) {
495
>
const fullRange = new Range(i + 1, match.index + 1, i + 1, match.index + fullMatch.length + 1);
496
>
if (markdownLinkRanges.some(mdRange => Range.areIntersectingOrTouching(mdRange, fullRange))) {
497
continue;
498
}
500
continue; // skip matches inside inline code
501
}
502
>
const contentMatch = match.groups?.['filePath'] || match.groups?.['toolName'];
promptFileParser.ts
503
>
if (!contentMatch) {
504
continue;
505
}
506
>
const startOffset = match.index + fullMatch.length - contentMatch.length;
promptFileParser.ts
507
>
const endOffset = match.index + fullMatch.length;
508
>
const range = new Range(i + 1, startOffset + 1, i + 1, endOffset + 1);
509
>
if (match.groups?.['filePath']) {
510
fileReferences.push({ content: match.groups?.['filePath'], range, isMarkdownLink: false });
512
variableReferences.push({ name: match.groups?.['toolName'], range, offset: lineStartOffset + match.index, fullLength: fullMatch.length });
513
}
515
lineStartOffset += line.length;
516
}