MRVA: Export results from query history

This commit is contained in:
shati-patel 2022-05-13 17:31:52 +01:00 коммит произвёл Shati Patel
Родитель be054ca4f8
Коммит 141f5381e7
2 изменённых файлов: 23 добавлений и 0 удалений

Просмотреть файл

@ -541,6 +541,10 @@
"command": "codeQLQueryHistory.showQueryText", "command": "codeQLQueryHistory.showQueryText",
"title": "Show Query Text" "title": "Show Query Text"
}, },
{
"command": "codeQLQueryHistory.exportResults",
"title": "Export Results"
},
{ {
"command": "codeQLQueryHistory.viewCsvResults", "command": "codeQLQueryHistory.viewCsvResults",
"title": "View Results (CSV)" "title": "View Results (CSV)"
@ -751,6 +755,11 @@
"group": "9_qlCommands", "group": "9_qlCommands",
"when": "view == codeQLQueryHistory" "when": "view == codeQLQueryHistory"
}, },
{
"command": "codeQLQueryHistory.exportResults",
"group": "9_qlCommands",
"when": "view == codeQLQueryHistory && viewItem == remoteResultsItem"
},
{ {
"command": "codeQLQueryHistory.viewCsvResults", "command": "codeQLQueryHistory.viewCsvResults",
"group": "9_qlCommands", "group": "9_qlCommands",
@ -973,6 +982,10 @@
"command": "codeQLQueryHistory.showQueryText", "command": "codeQLQueryHistory.showQueryText",
"when": "false" "when": "false"
}, },
{
"command": "codeQLQueryHistory.exportResults",
"when": "false"
},
{ {
"command": "codeQLQueryHistory.viewCsvResults", "command": "codeQLQueryHistory.viewCsvResults",
"when": "false" "when": "false"

Просмотреть файл

@ -450,6 +450,12 @@ export class QueryHistoryManager extends DisposableObject {
this.handleShowQueryText.bind(this) this.handleShowQueryText.bind(this)
) )
); );
this.push(
commandRunner(
'codeQLQueryHistory.exportResults',
this.handleExportResults.bind(this)
)
);
this.push( this.push(
commandRunner( commandRunner(
'codeQLQueryHistory.viewCsvResults', 'codeQLQueryHistory.viewCsvResults',
@ -991,6 +997,10 @@ export class QueryHistoryManager extends DisposableObject {
: item.remoteQuery.queryText; : item.remoteQuery.queryText;
} }
async handleExportResults(): Promise<void> {
await commands.executeCommand('codeQL.exportVariantAnalysisResults');
}
addQuery(item: QueryHistoryInfo) { addQuery(item: QueryHistoryInfo) {
this.treeDataProvider.pushQuery(item); this.treeDataProvider.pushQuery(item);
this.updateTreeViewSelectionIfVisible(); this.updateTreeViewSelectionIfVisible();