@@ -282,8 +282,10 @@ export class QueryHistoryManager extends DisposableObject {
282282 "codeQLQueryHistory.exportResults" : this . handleExportResults . bind ( this ) ,
283283 "codeQLQueryHistory.viewCsvResults" : this . handleViewCsvResults . bind ( this ) ,
284284 "codeQLQueryHistory.viewCsvAlerts" : this . handleViewCsvAlerts . bind ( this ) ,
285- "codeQLQueryHistory.viewSarifAlerts" :
285+ "codeQLQueryHistory.viewSarifAlerts" : createSingleSelectionCommand (
286286 this . handleViewSarifAlerts . bind ( this ) ,
287+ "query" ,
288+ ) ,
287289 "codeQLQueryHistory.viewDil" : this . handleViewDil . bind ( this ) ,
288290 "codeQLQueryHistory.itemClicked" : createSingleSelectionCommand (
289291 this . handleItemClicked . bind ( this ) ,
@@ -834,28 +836,20 @@ export class QueryHistoryManager extends DisposableObject {
834836 await window . showTextDocument ( doc , { preview : false } ) ;
835837 }
836838
837- async handleViewSarifAlerts (
838- singleItem : QueryHistoryInfo ,
839- multiSelect : QueryHistoryInfo [ ] | undefined ,
840- ) {
841- // Local queries only
842- if (
843- ! this . assertSingleQuery ( multiSelect ) ||
844- singleItem . t !== "local" ||
845- ! singleItem . completedQuery
846- ) {
839+ async handleViewSarifAlerts ( item : QueryHistoryInfo ) {
840+ if ( item . t !== "local" || ! item . completedQuery ) {
847841 return ;
848842 }
849843
850- const query = singleItem . completedQuery . query ;
844+ const query = item . completedQuery . query ;
851845 const hasInterpretedResults = query . canHaveInterpretedResults ( ) ;
852846 if ( hasInterpretedResults ) {
853847 await tryOpenExternalFile (
854848 this . app . commands ,
855849 query . resultsPaths . interpretedResultsPath ,
856850 ) ;
857851 } else {
858- const label = this . labelProvider . getLabel ( singleItem ) ;
852+ const label = this . labelProvider . getLabel ( item ) ;
859853 void showAndLogInformationMessage (
860854 `Query ${ label } has no interpreted results.` ,
861855 ) ;
0 commit comments