@@ -675,34 +675,15 @@ export class ReviewManager extends Disposable {
675675 }
676676 }
677677
678- private isKnownTabInputType ( tabInput : unknown ) : boolean {
679- // Note: This list includes all known TabInput types as of VS Code 1.107.0
680- // If new TabInput types are added to the VS Code API, this list will need to be updated
681- return (
682- tabInput instanceof vscode . TabInputText ||
683- tabInput instanceof vscode . TabInputTextDiff ||
684- tabInput instanceof vscode . TabInputCustom ||
685- tabInput instanceof vscode . TabInputWebview ||
686- tabInput instanceof vscode . TabInputNotebook ||
687- tabInput instanceof vscode . TabInputNotebookDiff ||
688- tabInput instanceof vscode . TabInputTerminal
689- ) ;
690- }
691-
692678 private async _closeOutdatedMultiDiffEditors ( pullRequest : PullRequestModel ) : Promise < void > {
693679 // Close any multidiff editors for this PR that may be outdated
694- // Since TabInputMultiDiff is not yet available in the VS Code API (https://github.com/microsoft/vscode/issues/206411),
695- // we identify multidiff editors by their label pattern
696- // Note: This label matching is dependent on the exact localized string format from PullRequestModel.openChanges()
697- // If that format changes, this matching logic will need to be updated as well
698680 const multiDiffLabel = vscode . l10n . t ( 'Changes in Pull Request #{0}' , pullRequest . number ) ;
699681
700682 const closePromises : Promise < boolean > [ ] = [ ] ;
701683 for ( const tabGroup of vscode . window . tabGroups . all ) {
702684 for ( const tab of tabGroup . tabs ) {
703- // Multidiff editors have a specific label pattern and the input type is unknown
704- // since TabInputMultiDiff doesn't exist yet
705- if ( tab . label === multiDiffLabel && ! this . isKnownTabInputType ( tab . input ) ) {
685+ // Check if this is a TabInputTextMultiDiff with matching label
686+ if ( tab . input instanceof vscode . TabInputTextMultiDiff && tab . label === multiDiffLabel ) {
706687 Logger . appendLine ( `Closing outdated multidiff editor for PR #${ pullRequest . number } ` , this . id ) ;
707688 closePromises . push ( Promise . resolve ( vscode . window . tabGroups . close ( tab ) ) ) ;
708689 }
0 commit comments