Skip to content

Commit b7b3ee2

Browse files
authored
Merge pull request #309939 from mjbvz/dev/mjbvz/assistant-eagle
Remove now unused `ChatSessionChangedFile` interface" (#308701)
2 parents 6a3da5f + 544542c commit b7b3ee2

File tree

8 files changed

+11
-43
lines changed

8 files changed

+11
-43
lines changed

extensions/copilot/src/extension/chatSessions/common/chatSessionWorktreeService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export interface IChatSessionWorktreeService {
7272

7373
getSessionIdForWorktree(folder: vscode.Uri): Promise<string | undefined>;
7474

75-
getWorktreeChanges(sessionId: string): Promise<readonly vscode.ChatSessionChangedFile2[] | undefined>;
75+
getWorktreeChanges(sessionId: string): Promise<readonly vscode.ChatSessionChangedFile[] | undefined>;
7676

7777
handleRequestCompleted(sessionId: string): Promise<void>;
7878

extensions/copilot/src/extension/chatSessions/vscode-node/chatSessionWorktreeServiceImpl.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ export class ChatSessionWorktreeService extends Disposable implements IChatSessi
319319
}
320320
}
321321

322-
async getWorktreeChanges(sessionId: string): Promise<readonly vscode.ChatSessionChangedFile2[] | undefined> {
322+
async getWorktreeChanges(sessionId: string): Promise<readonly vscode.ChatSessionChangedFile[] | undefined> {
323323
const worktreeProperties = await this.getWorktreeProperties(sessionId);
324324
if (!worktreeProperties || typeof worktreeProperties === 'string') {
325325
return undefined;
@@ -800,7 +800,7 @@ export class ChatSessionWorktreeService extends Disposable implements IChatSessi
800800
return { changes, ...repositoryState };
801801
}
802802

803-
private _toChatSessionChangedFile2(sessionId: string, change: ChatSessionWorktreeFile, worktreeProperties: ChatSessionWorktreeProperties): vscode.ChatSessionChangedFile2 {
803+
private _toChatSessionChangedFile2(sessionId: string, change: ChatSessionWorktreeFile, worktreeProperties: ChatSessionWorktreeProperties): vscode.ChatSessionChangedFile {
804804
let originalFileRef: string, modifiedFileRef: string | undefined;
805805
if (worktreeProperties.version === 2) {
806806
// Commit | Working tree
@@ -816,7 +816,7 @@ export class ChatSessionWorktreeService extends Disposable implements IChatSessi
816816
modifiedFileRef = worktreeProperties.branchName;
817817
}
818818

819-
return new vscode.ChatSessionChangedFile2(
819+
return new vscode.ChatSessionChangedFile(
820820
vscode.Uri.file(change.filePath),
821821
change.originalFilePath
822822
? toGitUri(vscode.Uri.file(change.originalFilePath), originalFileRef)

extensions/copilot/src/extension/chatSessions/vscode-node/copilotCLIChatSessions.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -371,13 +371,13 @@ export class CopilotCLIChatSessionContentProvider extends Disposable implements
371371
sessionId: string,
372372
worktreeProperties: Awaited<ReturnType<IChatSessionWorktreeService['getWorktreeProperties']>>,
373373
workingDirectory: vscode.Uri | undefined,
374-
): Promise<vscode.ChatSessionChangedFile2[]> {
375-
const changes: vscode.ChatSessionChangedFile2[] = [];
374+
): Promise<vscode.ChatSessionChangedFile[]> {
375+
const changes: vscode.ChatSessionChangedFile[] = [];
376376
if (worktreeProperties?.repositoryPath && await vscode.workspace.isResourceTrusted(vscode.Uri.file(worktreeProperties.repositoryPath))) {
377377
changes.push(...(await this.copilotCLIWorktreeManagerService.getWorktreeChanges(sessionId) ?? []));
378378
} else if (workingDirectory && await vscode.workspace.isResourceTrusted(workingDirectory)) {
379379
const workspaceChanges = await this._workspaceFolderService.getWorkspaceChanges(sessionId) ?? [];
380-
changes.push(...workspaceChanges.map(change => new vscode.ChatSessionChangedFile2(
380+
changes.push(...workspaceChanges.map(change => new vscode.ChatSessionChangedFile(
381381
vscode.Uri.file(change.filePath),
382382
change.originalFilePath
383383
? toGitUri(vscode.Uri.file(change.originalFilePath), 'HEAD')

extensions/copilot/src/extension/chatSessions/vscode-node/copilotCLIChatSessionsContribution.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,14 +266,14 @@ export class CopilotCLIChatSessionItemProvider extends Disposable implements vsc
266266
}
267267

268268
// Statistics (only returned for trusted workspace/worktree folders)
269-
const changes: vscode.ChatSessionChangedFile2[] = [];
269+
const changes: vscode.ChatSessionChangedFile[] = [];
270270
if (worktreeProperties?.repositoryPath && await vscode.workspace.isResourceTrusted(vscode.Uri.file(worktreeProperties.repositoryPath))) {
271271
// Worktree
272272
changes.push(...(await this.worktreeManager.getWorktreeChanges(session.id) ?? []));
273273
} else if (workingDirectory && await vscode.workspace.isResourceTrusted(workingDirectory)) {
274274
// Workspace
275275
const workspaceChanges = await this.workspaceFolderService.getWorkspaceChanges(session.id) ?? [];
276-
changes.push(...workspaceChanges.map(change => new vscode.ChatSessionChangedFile2(
276+
changes.push(...workspaceChanges.map(change => new vscode.ChatSessionChangedFile(
277277
vscode.Uri.file(change.filePath),
278278
change.originalFilePath
279279
? toGitUri(vscode.Uri.file(change.originalFilePath), 'HEAD')

extensions/copilot/src/extension/chatSessions/vscode-node/copilotCloudSessionsProvider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1176,7 +1176,7 @@ export class CopilotCloudSessionsProvider extends Disposable implements vscode.C
11761176
}
11771177

11781178
const multiDiffPart = await this._prFileChangesService.getFileChangesMultiDiffPart(pr);
1179-
const changes = multiDiffPart?.value?.map(change => new vscode.ChatSessionChangedFile2(
1179+
const changes = multiDiffPart?.value?.map(change => new vscode.ChatSessionChangedFile(
11801180
change.goToFileUri!,
11811181
change.originalUri,
11821182
change.modifiedUri,

src/vs/workbench/api/common/extHost.api.impl.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2132,7 +2132,6 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
21322132
InteractiveSessionVoteDirection: extHostTypes.InteractiveSessionVoteDirection,
21332133
ChatCopyKind: extHostTypes.ChatCopyKind,
21342134
ChatSessionChangedFile: extHostTypes.ChatSessionChangedFile,
2135-
ChatSessionChangedFile2: extHostTypes.ChatSessionChangedFile2,
21362135
ChatEditingSessionActionOutcome: extHostTypes.ChatEditingSessionActionOutcome,
21372136
InteractiveEditorResponseFeedbackKind: extHostTypes.InteractiveEditorResponseFeedbackKind,
21382137
DebugStackFrame: extHostTypes.DebugStackFrame,

src/vs/workbench/api/common/extHostTypes.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3791,10 +3791,6 @@ export class ChatDebugEventHookContent {
37913791
}
37923792

37933793
export class ChatSessionChangedFile {
3794-
constructor(public readonly modifiedUri: vscode.Uri, public readonly insertions: number, public readonly deletions: number, public readonly originalUri?: vscode.Uri) { }
3795-
}
3796-
3797-
export class ChatSessionChangedFile2 {
37983794
constructor(public readonly uri: vscode.Uri, public readonly originalUri: vscode.Uri | undefined, public readonly modifiedUri: vscode.Uri | undefined, public readonly insertions: number, public readonly deletions: number) { }
37993795
}
38003796

src/vscode-dts/vscode.proposed.chatSessionsProvider.d.ts

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ declare module 'vscode' {
343343
/**
344344
* Statistics about the chat session.
345345
*/
346-
changes?: readonly ChatSessionChangedFile[] | readonly ChatSessionChangedFile2[];
346+
changes?: readonly ChatSessionChangedFile[];
347347

348348
/**
349349
* Arbitrary metadata for the chat session. Can be anything, but must be JSON-stringifyable.
@@ -353,34 +353,7 @@ declare module 'vscode' {
353353
metadata?: { readonly [key: string]: any };
354354
}
355355

356-
/**
357-
* @deprecated Use `ChatSessionChangedFile2` instead
358-
*/
359356
export class ChatSessionChangedFile {
360-
/**
361-
* URI of the file.
362-
*/
363-
modifiedUri: Uri;
364-
365-
/**
366-
* File opened when the user takes the 'compare' action.
367-
*/
368-
originalUri?: Uri;
369-
370-
/**
371-
* Number of insertions made during the session.
372-
*/
373-
insertions: number;
374-
375-
/**
376-
* Number of deletions made during the session.
377-
*/
378-
deletions: number;
379-
380-
constructor(modifiedUri: Uri, insertions: number, deletions: number, originalUri?: Uri);
381-
}
382-
383-
export class ChatSessionChangedFile2 {
384357
/**
385358
* URI of the file.
386359
*/

0 commit comments

Comments
 (0)