@@ -306,20 +306,20 @@ export class QueryHistoryManager extends DisposableObject {
306
306
) ;
307
307
this . push (
308
308
commandRunner (
309
- 'codeQLQueryHistory.exportCsvResults ' ,
310
- this . handleExportCsvResults . bind ( this )
309
+ 'codeQLQueryHistory.viewCsvResults ' ,
310
+ this . handleViewCsvResults . bind ( this )
311
311
)
312
312
) ;
313
313
this . push (
314
314
commandRunner (
315
- 'codeQLQueryHistory.viewCsvResults ' ,
316
- this . handleViewCsvResults . bind ( this )
315
+ 'codeQLQueryHistory.viewCsvAlerts ' ,
316
+ this . handleViewCsvAlerts . bind ( this )
317
317
)
318
318
) ;
319
319
this . push (
320
320
commandRunner (
321
- 'codeQLQueryHistory.viewSarifResults ' ,
322
- this . handleViewSarifResults . bind ( this )
321
+ 'codeQLQueryHistory.viewSarifAlerts ' ,
322
+ this . handleViewSarifAlerts . bind ( this )
323
323
)
324
324
) ;
325
325
this . push (
@@ -556,7 +556,7 @@ export class QueryHistoryManager extends DisposableObject {
556
556
await vscode . window . showTextDocument ( doc , { preview : false } ) ;
557
557
}
558
558
559
- async handleViewSarifResults (
559
+ async handleViewSarifAlerts (
560
560
singleItem : CompletedQuery ,
561
561
multiSelect : CompletedQuery [ ]
562
562
) {
@@ -577,33 +577,25 @@ export class QueryHistoryManager extends DisposableObject {
577
577
}
578
578
}
579
579
580
- async handleExportCsvResults (
580
+ async handleViewCsvResults (
581
581
singleItem : CompletedQuery ,
582
582
multiSelect : CompletedQuery [ ]
583
583
) {
584
584
if ( ! this . assertSingleQuery ( multiSelect ) ) {
585
585
return ;
586
586
}
587
-
588
- const saveLocation = await vscode . window . showSaveDialog ( {
589
- title : 'CSV Results' ,
590
- saveLabel : 'Export' ,
591
- filters : {
592
- 'Comma-separated values' : [ 'csv' ] ,
593
- }
594
- } ) ;
595
- if ( ! saveLocation ) {
596
- void showAndLogErrorMessage ( 'No save location selected for CSV export!' ) ;
587
+ if ( await singleItem . query . hasCsv ( ) ) {
588
+ void this . tryOpenExternalFile ( singleItem . query . csvPath ) ;
597
589
return ;
598
590
}
599
- await singleItem . query . exportCsvResults ( this . qs , saveLocation . fsPath , ( ) => {
591
+ await singleItem . query . exportCsvResults ( this . qs , singleItem . query . csvPath , ( ) => {
600
592
void this . tryOpenExternalFile (
601
- saveLocation . fsPath
593
+ singleItem . query . csvPath
602
594
) ;
603
595
} ) ;
604
596
}
605
597
606
- async handleViewCsvResults (
598
+ async handleViewCsvAlerts (
607
599
singleItem : CompletedQuery ,
608
600
multiSelect : CompletedQuery [ ]
609
601
) {
0 commit comments