@@ -280,7 +280,10 @@ export class QueryHistoryManager extends DisposableObject {
280280 this . handleCancel . bind ( this ) ,
281281 ) ,
282282 "codeQLQueryHistory.exportResults" : this . handleExportResults . bind ( this ) ,
283- "codeQLQueryHistory.viewCsvResults" : this . handleViewCsvResults . bind ( this ) ,
283+ "codeQLQueryHistory.viewCsvResults" : createSingleSelectionCommand (
284+ this . handleViewCsvResults . bind ( this ) ,
285+ "query" ,
286+ ) ,
284287 "codeQLQueryHistory.viewCsvAlerts" : this . handleViewCsvAlerts . bind ( this ) ,
285288 "codeQLQueryHistory.viewSarifAlerts" : createSingleSelectionCommand (
286289 this . handleViewSarifAlerts . bind ( this ) ,
@@ -856,19 +859,11 @@ export class QueryHistoryManager extends DisposableObject {
856859 }
857860 }
858861
859- async handleViewCsvResults (
860- singleItem : QueryHistoryInfo ,
861- multiSelect : QueryHistoryInfo [ ] | undefined ,
862- ) {
863- // Local queries only
864- if (
865- ! this . assertSingleQuery ( multiSelect ) ||
866- singleItem . t !== "local" ||
867- ! singleItem . completedQuery
868- ) {
862+ async handleViewCsvResults ( item : QueryHistoryInfo ) {
863+ if ( item . t !== "local" || ! item . completedQuery ) {
869864 return ;
870865 }
871- const query = singleItem . completedQuery . query ;
866+ const query = item . completedQuery . query ;
872867 if ( await query . hasCsv ( ) ) {
873868 void tryOpenExternalFile ( this . app . commands , query . csvPath ) ;
874869 return ;
0 commit comments