Skip to content

Commit ccd73b2

Browse files
Convert handleShowEvalLog to use createSingleSelectionCommand
1 parent 921cf60 commit ccd73b2

1 file changed

Lines changed: 8 additions & 9 deletions

File tree

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

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,10 @@ export class QueryHistoryManager extends DisposableObject {
252252
"query",
253253
),
254254
"codeQLQueryHistory.compareWith": this.handleCompareWith.bind(this),
255-
"codeQLQueryHistory.showEvalLog": this.handleShowEvalLog.bind(this),
255+
"codeQLQueryHistory.showEvalLog": createSingleSelectionCommand(
256+
this.handleShowEvalLog.bind(this),
257+
"query",
258+
),
256259
"codeQLQueryHistory.showEvalLogSummary":
257260
this.handleShowEvalLogSummary.bind(this),
258261
"codeQLQueryHistory.showEvalLogViewer":
@@ -725,17 +728,13 @@ export class QueryHistoryManager extends DisposableObject {
725728
);
726729
}
727730

728-
async handleShowEvalLog(
729-
singleItem: QueryHistoryInfo,
730-
multiSelect: QueryHistoryInfo[] | undefined,
731-
) {
732-
// Only applicable to an individual local query
733-
if (!this.assertSingleQuery(multiSelect) || singleItem.t !== "local") {
731+
async handleShowEvalLog(item: QueryHistoryInfo) {
732+
if (item.t !== "local") {
734733
return;
735734
}
736735

737-
if (singleItem.evalLogLocation) {
738-
await tryOpenExternalFile(this.app.commands, singleItem.evalLogLocation);
736+
if (item.evalLogLocation) {
737+
await tryOpenExternalFile(this.app.commands, item.evalLogLocation);
739738
} else {
740739
this.warnNoEvalLogs();
741740
}

0 commit comments

Comments
 (0)