diff --git a/extensions/ql-vscode/package.json b/extensions/ql-vscode/package.json index 1c4c83daf..20ec9fa64 100644 --- a/extensions/ql-vscode/package.json +++ b/extensions/ql-vscode/package.json @@ -541,6 +541,10 @@ "command": "codeQLQueryHistory.showQueryText", "title": "Show Query Text" }, + { + "command": "codeQLQueryHistory.exportResults", + "title": "Export Results" + }, { "command": "codeQLQueryHistory.viewCsvResults", "title": "View Results (CSV)" @@ -751,6 +755,11 @@ "group": "9_qlCommands", "when": "view == codeQLQueryHistory" }, + { + "command": "codeQLQueryHistory.exportResults", + "group": "9_qlCommands", + "when": "view == codeQLQueryHistory && viewItem == remoteResultsItem" + }, { "command": "codeQLQueryHistory.viewCsvResults", "group": "9_qlCommands", @@ -973,6 +982,10 @@ "command": "codeQLQueryHistory.showQueryText", "when": "false" }, + { + "command": "codeQLQueryHistory.exportResults", + "when": "false" + }, { "command": "codeQLQueryHistory.viewCsvResults", "when": "false" diff --git a/extensions/ql-vscode/src/query-history.ts b/extensions/ql-vscode/src/query-history.ts index f8004d25b..b2e114792 100644 --- a/extensions/ql-vscode/src/query-history.ts +++ b/extensions/ql-vscode/src/query-history.ts @@ -450,6 +450,12 @@ export class QueryHistoryManager extends DisposableObject { this.handleShowQueryText.bind(this) ) ); + this.push( + commandRunner( + 'codeQLQueryHistory.exportResults', + this.handleExportResults.bind(this) + ) + ); this.push( commandRunner( 'codeQLQueryHistory.viewCsvResults', @@ -991,6 +997,10 @@ export class QueryHistoryManager extends DisposableObject { : item.remoteQuery.queryText; } + async handleExportResults(): Promise { + await commands.executeCommand('codeQL.exportVariantAnalysisResults'); + } + addQuery(item: QueryHistoryInfo) { this.treeDataProvider.pushQuery(item); this.updateTreeViewSelectionIfVisible();