File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change 66
77import * as vscode from 'vscode' ;
88import { COPILOT_LOGINS } from '../../common/copilot' ;
9+ import { GitChangeType , InMemFileChange } from '../../common/file' ;
910import Logger from '../../common/logger' ;
1011import { CopilotRemoteAgentManager } from '../../github/copilotRemoteAgent' ;
1112import { PullRequestModel } from '../../github/pullRequestModel' ;
@@ -153,6 +154,13 @@ export class ActivePullRequestTool implements vscode.LanguageModelTool<FetchIssu
153154 } ,
154155 isDraft : pullRequest . isDraft ,
155156 codingAgentSession,
157+ changes : ( await pullRequest . getFileChangesInfo ( ) ) . map ( change => {
158+ if ( change instanceof InMemFileChange ) {
159+ return change . diffHunks ?. map ( hunk => hunk . diffLines . map ( line => line . raw ) . join ( '\n' ) ) . join ( '\n' ) || '' ;
160+ } else {
161+ return `File: ${ change . fileName } was ${ change . status === GitChangeType . ADD ? 'added' : change . status === GitChangeType . DELETE ? 'deleted' : 'modified' } .` ;
162+ }
163+ } )
156164 } ;
157165
158166 return new vscode . LanguageModelToolResult ( [ new vscode . LanguageModelTextPart ( JSON . stringify ( pullRequestInfo ) ) ] ) ;
You can’t perform that action at this time.
0 commit comments