Skip to content

Commit 21757ae

Browse files
Convert handleShowQueryLog to use createSingleSelectionCommand
1 parent a0a4a06 commit 21757ae

1 file changed

Lines changed: 8 additions & 12 deletions

File tree

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

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,10 @@ export class QueryHistoryManager extends DisposableObject {
257257
this.handleShowEvalLogSummary.bind(this),
258258
"codeQLQueryHistory.showEvalLogViewer":
259259
this.handleShowEvalLogViewer.bind(this),
260-
"codeQLQueryHistory.showQueryLog": this.handleShowQueryLog.bind(this),
260+
"codeQLQueryHistory.showQueryLog": createSingleSelectionCommand(
261+
this.handleShowQueryLog.bind(this),
262+
"query",
263+
),
261264
"codeQLQueryHistory.showQueryText": this.handleShowQueryText.bind(this),
262265
"codeQLQueryHistory.openQueryDirectory":
263266
this.handleOpenQueryDirectory.bind(this),
@@ -624,23 +627,16 @@ export class QueryHistoryManager extends DisposableObject {
624627
}
625628
}
626629

627-
async handleShowQueryLog(
628-
singleItem: QueryHistoryInfo,
629-
multiSelect: QueryHistoryInfo[] | undefined,
630-
) {
630+
async handleShowQueryLog(item: QueryHistoryInfo) {
631631
// Local queries only
632-
if (!this.assertSingleQuery(multiSelect) || singleItem?.t !== "local") {
633-
return;
634-
}
635-
636-
if (!singleItem.completedQuery) {
632+
if (item?.t !== "local" || !item.completedQuery) {
637633
return;
638634
}
639635

640-
if (singleItem.completedQuery.logFileLocation) {
636+
if (item.completedQuery.logFileLocation) {
641637
await tryOpenExternalFile(
642638
this.app.commands,
643-
singleItem.completedQuery.logFileLocation,
639+
item.completedQuery.logFileLocation,
644640
);
645641
} else {
646642
void showAndLogWarningMessage("No log file available");

0 commit comments

Comments
 (0)