Skip to content

Commit d6ae5b1

Browse files
committed
Add exporting of results to view
This will allow a user to export the results from the view by clicking the "Export results" button.
1 parent 922d212 commit d6ae5b1

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

extensions/ql-vscode/src/pure/interface-types.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,10 @@ export interface CopyRepositoryListMessage {
476476
t: 'copyRepositoryList';
477477
}
478478

479+
export interface ExportResultsMessage {
480+
t: 'exportResults';
481+
}
482+
479483
export interface OpenLogsMessage {
480484
t: 'openLogs';
481485
}
@@ -495,5 +499,6 @@ export type FromVariantAnalysisMessage =
495499
| OpenQueryFileMessage
496500
| OpenQueryTextMessage
497501
| CopyRepositoryListMessage
502+
| ExportResultsMessage
498503
| OpenLogsMessage
499504
| CancelVariantAnalysisMessage;

extensions/ql-vscode/src/remote-queries/variant-analysis-view.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,9 @@ export class VariantAnalysisView extends AbstractWebview<ToVariantAnalysisMessag
106106
case 'copyRepositoryList':
107107
void commands.executeCommand('codeQL.copyVariantAnalysisRepoList', this.variantAnalysisId);
108108
break;
109+
case 'exportResults':
110+
void commands.executeCommand('codeQL.exportVariantAnalysisResults', this.variantAnalysisId);
111+
break;
109112
case 'openLogs':
110113
await this.openLogs();
111114
break;

extensions/ql-vscode/src/view/variant-analysis/VariantAnalysis.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ const copyRepositoryList = () => {
4242
});
4343
};
4444

45+
const exportResults = () => {
46+
vscode.postMessage({
47+
t: 'exportResults',
48+
});
49+
};
50+
4551
const openLogs = () => {
4652
vscode.postMessage({
4753
t: 'openLogs',
@@ -102,7 +108,7 @@ export function VariantAnalysis({
102108
onViewQueryTextClick={openQueryText}
103109
onStopQueryClick={stopQuery}
104110
onCopyRepositoryListClick={copyRepositoryList}
105-
onExportResultsClick={() => console.log('Export results')}
111+
onExportResultsClick={exportResults}
106112
onViewLogsClick={openLogs}
107113
/>
108114
<VariantAnalysisOutcomePanels

0 commit comments

Comments
 (0)