supportFileAttachment in new coding agent editor#7744
Merged
joshspicer merged 3 commits intomainfrom Sep 3, 2025
Merged
Conversation
justschen
approved these changes
Sep 3, 2025
rebornix
reviewed
Sep 3, 2025
|
|
||
| cleanPrompt(prompt: string): string { | ||
| // Remove #file:xxxx from the prompt | ||
| return prompt.replace(/#file:\S+/g, '').trim(); |
Member
There was a problem hiding this comment.
We want to keep the file name (or relative file path) in the prompt, for example, user might write add tests to #file:x.ts, if we replace it completely and include multiple files as relevant files, the prompt itself might be ambiguous as it reads as add tests to.
alexr00
reviewed
Sep 9, 2025
| public async provideNewChatSessionItem(options: { prompt?: string; history: ReadonlyArray<vscode.ChatRequestTurn | vscode.ChatResponseTurn>; metadata?: any; }, token: vscode.CancellationToken): Promise<ChatSessionWithPR | ChatSessionFromSummarizedChat> { | ||
| const { prompt, history } = options; | ||
| if (!prompt) { | ||
| extractFileReferences(references: readonly ChatPromptReference[] | undefined): string | undefined { |
alexr00
reviewed
Sep 9, 2025
Comment on lines
+762
to
+766
| const workspaceFolder = vscode.workspace.getWorkspaceFolder(ref.value); | ||
| if (workspaceFolder) { | ||
| const relativePath = pathLib.relative(workspaceFolder.uri.fsPath, ref.value.fsPath); | ||
| parts.push(` - ${relativePath}`); | ||
| } |
Member
There was a problem hiding this comment.
This will be relative to the workspace folder, not the git repo. Instead, you should use getRepositoryForFile:
vscode-pull-request-github/src/github/utils.ts
Lines 1462 to 1463 in 91c5123
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Initial support for file attachments. Attaches the relative name of the file.
similar to microsoft/vscode#264740 but this is in the chat session editor