Skip to content

Commit 0c87e71

Browse files
Copilotalexr00
andcommitted
Add documentation comments based on code review feedback
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
1 parent 897facd commit 0c87e71

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/view/reviewManager.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -963,6 +963,8 @@ export class ReviewManager extends Disposable {
963963
}
964964

965965
private isKnownTabInputType(tabInput: unknown): boolean {
966+
// Note: This list includes all known TabInput types as of VS Code 1.107.0
967+
// If new TabInput types are added to the VS Code API, this list will need to be updated
966968
return (
967969
tabInput instanceof vscode.TabInputText ||
968970
tabInput instanceof vscode.TabInputTextDiff ||
@@ -980,12 +982,14 @@ export class ReviewManager extends Disposable {
980982
// Close any multidiff editors for this PR that may be outdated
981983
// Since TabInputMultiDiff is not yet available in the VS Code API (https://github.com/microsoft/vscode/issues/206411),
982984
// we identify multidiff editors by their label pattern
985+
// Note: This label matching is dependent on the exact localized string format from PullRequestModel.openChanges()
986+
// If that format changes, this matching logic will need to be updated as well
983987
const multiDiffLabel = vscode.l10n.t(
984988
'Changes in Pull Request #{0}',
985989
pullRequest.number,
986990
);
987991

988-
const closePromises: Thenable<boolean>[] = [];
992+
const closePromises: Promise<boolean>[] = [];
989993
for (const tabGroup of vscode.window.tabGroups.all) {
990994
for (const tab of tabGroup.tabs) {
991995
// Multidiff editors have a specific label pattern and the input type is unknown
@@ -998,7 +1002,7 @@ export class ReviewManager extends Disposable {
9981002
`Closing outdated multidiff editor for PR #${pullRequest.number}`,
9991003
this.id,
10001004
);
1001-
closePromises.push(vscode.window.tabGroups.close(tab));
1005+
closePromises.push(Promise.resolve(vscode.window.tabGroups.close(tab)));
10021006
}
10031007
}
10041008
}

0 commit comments

Comments
 (0)