Skip to content

Commit

Permalink
Revert "refactor(prompt): remove wrapJoinedMentions parameter from se…
Browse files Browse the repository at this point in the history
…lectedCodePromptWithExtraFiles"

This reverts commit 46b9fa0.
  • Loading branch information
David Ichim authored and David Ichim committed Feb 7, 2025
1 parent 46b9fa0 commit 813025b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions vscode/src/commands/execute/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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}`
}`
}
2 changes: 1 addition & 1 deletion vscode/src/prompts/prompt-hydration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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],
]
Expand Down

0 comments on commit 813025b

Please sign in to comment.