Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"quickDiffProvider",
"remoteCodingAgents",
"shareProvider",
"tabInputMultiDiff",
"tokenInformation",
"treeItemMarkdownLabel",
"treeViewMarkdownMessage"
Expand Down
1 change: 1 addition & 0 deletions src/@types/vscode.proposed.chatParticipantAdditions.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ declare module 'vscode' {
isComplete?: boolean;
toolSpecificData?: ChatTerminalToolInvocationData;
fromSubAgent?: boolean;
presentation?: 'hidden' | 'hiddenAfterComplete' | undefined;

constructor(toolName: string, toolCallId: string, isError?: boolean);
}
Expand Down
5 changes: 5 additions & 0 deletions src/@types/vscode.proposed.chatSessionsProvider.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@ declare module 'vscode' {
*/
description?: string | MarkdownString;

/**
* An optional badge that provides additional context about the chat session.
*/
badge?: string | MarkdownString;

/**
* An optional status indicating the current state of the session.
*/
Expand Down
22 changes: 22 additions & 0 deletions src/@types/vscode.proposed.tabInputMultiDiff.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

// https://github.com/microsoft/vscode/issues/206411

declare module 'vscode' {

export class TabInputTextMultiDiff {

readonly textDiffs: TabInputTextDiff[];

constructor(textDiffs: TabInputTextDiff[]);
}

export interface Tab {

readonly input: TabInputText | TabInputTextDiff | TabInputTextMultiDiff | TabInputCustom | TabInputWebview | TabInputNotebook | TabInputNotebookDiff | TabInputTerminal | unknown;

}
}
20 changes: 20 additions & 0 deletions src/view/reviewManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,27 @@ export class ReviewManager extends Disposable {
}
}

private async _closeOutdatedMultiDiffEditors(pullRequest: PullRequestModel): Promise<void> {
// Close any multidiff editors for this PR that may be outdated
const multiDiffLabel = vscode.l10n.t('Changes in Pull Request #{0}', pullRequest.number);

const closePromises: Promise<boolean>[] = [];
for (const tabGroup of vscode.window.tabGroups.all) {
for (const tab of tabGroup.tabs) {
// Check if this is a TabInputTextMultiDiff with matching label
if (tab.input instanceof vscode.TabInputTextMultiDiff && tab.label.startsWith(multiDiffLabel)) {
Logger.appendLine(`Closing outdated multidiff editor for PR #${pullRequest.number}`, this.id);
closePromises.push(Promise.resolve(vscode.window.tabGroups.close(tab)));
}
}
}
await Promise.all(closePromises);
}

public async _upgradePullRequestEditors(pullRequest: PullRequestModel) {
// Close any outdated multidiff editors first
await this._closeOutdatedMultiDiffEditors(pullRequest);

// Go through all open editors and find pr scheme editors that belong to the active pull request.
// Close the editors, and reopen them from the pull request.
const reopenFilenames: Set<[PRUriParams, PRUriParams]> = new Set();
Expand Down