Skip to content

Commit be6f356

Browse files
Convert handleOpenOnGithub to use createSingleSelectionCommand
1 parent 1ea0f14 commit be6f356

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

extensions/ql-vscode/src/query-history/query-history-manager.ts

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,10 @@ export class QueryHistoryManager extends DisposableObject {
300300
this.handleItemClicked.bind(this),
301301
"query",
302302
),
303-
"codeQLQueryHistory.openOnGithub": this.handleOpenOnGithub.bind(this),
303+
"codeQLQueryHistory.openOnGithub": createSingleSelectionCommand(
304+
this.handleOpenOnGithub.bind(this),
305+
"query",
306+
),
304307
"codeQLQueryHistory.copyRepoList": this.handleCopyRepoList.bind(this),
305308

306309
"codeQL.exportSelectedVariantAnalysisResults":
@@ -904,18 +907,12 @@ export class QueryHistoryManager extends DisposableObject {
904907
);
905908
}
906909

907-
async handleOpenOnGithub(
908-
singleItem: QueryHistoryInfo,
909-
multiSelect: QueryHistoryInfo[] | undefined,
910-
) {
911-
if (
912-
!this.assertSingleQuery(multiSelect) ||
913-
singleItem.t !== "variant-analysis"
914-
) {
910+
async handleOpenOnGithub(item: QueryHistoryInfo) {
911+
if (item.t !== "variant-analysis") {
915912
return;
916913
}
917914

918-
const actionsWorkflowRunUrl = getActionsWorkflowRunUrl(singleItem);
915+
const actionsWorkflowRunUrl = getActionsWorkflowRunUrl(item);
919916

920917
await this.app.commands.execute(
921918
"vscode.open",

0 commit comments

Comments
 (0)