diff --git a/.github/instructions/chat.instructions.md b/.github/instructions/chat.instructions.md index c1d1061bb56..657866be205 100644 --- a/.github/instructions/chat.instructions.md +++ b/.github/instructions/chat.instructions.md @@ -1,5 +1,4 @@ --- -applyTo: '**/chat/**' description: Chat feature area coding guidelines --- diff --git a/.github/instructions/interactive.instructions.md b/.github/instructions/interactive.instructions.md index 21ed92f6460..d6867257e66 100644 --- a/.github/instructions/interactive.instructions.md +++ b/.github/instructions/interactive.instructions.md @@ -1,6 +1,5 @@ --- -applyTo: '**/interactive/**' -description: Architecture documentation for VS Code interactive window component +description: Architecture documentation for VS Code interactive window component. Use when working in folder --- # Interactive Window diff --git a/.github/instructions/learnings.instructions.md b/.github/instructions/learnings.instructions.md index 9358a943e3d..22fa31ae474 100644 --- a/.github/instructions/learnings.instructions.md +++ b/.github/instructions/learnings.instructions.md @@ -1,5 +1,4 @@ --- -applyTo: ** description: This document describes how to deal with learnings that you make. (meta instruction) --- diff --git a/.github/instructions/notebook.instructions.md b/.github/instructions/notebook.instructions.md index 3d78e744d31..890b0c20db2 100644 --- a/.github/instructions/notebook.instructions.md +++ b/.github/instructions/notebook.instructions.md @@ -1,5 +1,4 @@ --- -applyTo: '**/notebook/**' description: Architecture documentation for VS Code notebook and interactive window components --- diff --git a/src/vs/workbench/contrib/chat/common/promptSyntax/promptFileParser.ts b/src/vs/workbench/contrib/chat/common/promptSyntax/promptFileParser.ts index 59d21a4755a..33094047675 100644 --- a/src/vs/workbench/contrib/chat/common/promptSyntax/promptFileParser.ts +++ b/src/vs/workbench/contrib/chat/common/promptSyntax/promptFileParser.ts @@ -346,6 +346,9 @@ export class PromptBody { // Match markdown links: [text](link) const linkMatch = line.matchAll(/\[(.*?)\]\((.+?)\)/g); for (const match of linkMatch) { + if (match.index > 0 && line[match.index - 1] === '!') { + continue; // skip image links + } const linkEndOffset = match.index + match[0].length - 1; // before the parenthesis const linkStartOffset = match.index + match[0].length - match[2].length - 1; const range = new Range(i + 1, linkStartOffset + 1, i + 1, linkEndOffset + 1); diff --git a/src/vs/workbench/contrib/chat/test/common/promptSyntax/service/newPromptsParser.test.ts b/src/vs/workbench/contrib/chat/test/common/promptSyntax/service/newPromptsParser.test.ts index b08976de84b..cb5fed7747b 100644 --- a/src/vs/workbench/contrib/chat/test/common/promptSyntax/service/newPromptsParser.test.ts +++ b/src/vs/workbench/contrib/chat/test/common/promptSyntax/service/newPromptsParser.test.ts @@ -22,7 +22,7 @@ suite('NewPromptsParser', () => { /* 04 */`tools: ['tool1', 'tool2']`, /* 05 */'---', /* 06 */'This is an agent test.', - /* 07 */'Here is a #tool:tool1 variable (and one with closing parenthesis after: #tool:tool-2) and a #file:./reference1.md as well as a [reference](./reference2.md).', + /* 07 */'Here is a #tool:tool1 variable (and one with closing parenthesis after: #tool:tool-2) and a #file:./reference1.md as well as a [reference](./reference2.md) and an image ![image](./image.png).', ].join('\n'); const result = new PromptFileParser().parse(uri, content); assert.deepEqual(result.uri, uri); @@ -42,7 +42,7 @@ suite('NewPromptsParser', () => { ]); assert.deepEqual(result.body.range, { startLineNumber: 6, startColumn: 1, endLineNumber: 8, endColumn: 1 }); assert.equal(result.body.offset, 75); - assert.equal(result.body.getContent(), 'This is an agent test.\nHere is a #tool:tool1 variable (and one with closing parenthesis after: #tool:tool-2) and a #file:./reference1.md as well as a [reference](./reference2.md).'); + assert.equal(result.body.getContent(), 'This is an agent test.\nHere is a #tool:tool1 variable (and one with closing parenthesis after: #tool:tool-2) and a #file:./reference1.md as well as a [reference](./reference2.md) and an image ![image](./image.png).'); assert.deepEqual(result.body.fileReferences, [ { range: new Range(7, 99, 7, 114), content: './reference1.md', isMarkdownLink: false },