diff --git a/vscode/src/commands/execute/index.ts b/vscode/src/commands/execute/index.ts index 51b23301d220..8bf73fdcc3ad 100644 --- a/vscode/src/commands/execute/index.ts +++ b/vscode/src/commands/execute/index.ts @@ -70,7 +70,8 @@ export async function executeDefaultCommand( export function selectedCodePromptWithExtraFiles( primary: ContextItem, - other: ContextItem[] + other: ContextItem[], + wrapJoinedMentions = true ): PromptString { const primaryMention = ps`@${PromptString.fromDisplayPathLineRange(primary.uri, primary.range)}` const otherMentions = other.map( @@ -81,5 +82,7 @@ export function selectedCodePromptWithExtraFiles( } const joinedMentions = PromptString.join(otherMentions, ps` `) - return ps`${primaryMention} ${joinedMentions}` + return ps`${primaryMention}${ + wrapJoinedMentions ? ps` ( ${joinedMentions} )` : ps` ${joinedMentions}` + }` } diff --git a/vscode/src/prompts/prompt-hydration.ts b/vscode/src/prompts/prompt-hydration.ts index 5c5526f4ad0d..a3f501a1a05b 100644 --- a/vscode/src/prompts/prompt-hydration.ts +++ b/vscode/src/prompts/prompt-hydration.ts @@ -235,7 +235,7 @@ async function hydrateWithOpenTabs(promptText: PromptString): Promise<[PromptStr return [ promptText.replaceAll( PROMPT_EDITOR_OPEN_TABS_PLACEHOLDER, - selectedCodePromptWithExtraFiles(firstOpenTab, otherOpenTabs) + selectedCodePromptWithExtraFiles(firstOpenTab, otherOpenTabs, false) ), [firstOpenTab, ...otherOpenTabs], ]