File tree Expand file tree Collapse file tree 4 files changed +32
-1
lines changed
Expand file tree Collapse file tree 4 files changed +32
-1
lines changed Original file line number Diff line number Diff line change 958958 "command" : " codeQLQueryHistory.copyRepoList" ,
959959 "title" : " Copy Repository List"
960960 },
961+ {
962+ "command" : " codeQLQueryHistory.viewAutofixes" ,
963+ "title" : " View Autofixes"
964+ },
961965 {
962966 "command" : " codeQLQueryResults.down" ,
963967 "title" : " CodeQL: Navigate Down in Local Result Viewer"
12961300 "group" : " 1_queryHistory@1" ,
12971301 "when" : " viewItem == remoteResultsItem"
12981302 },
1303+ {
1304+ "command" : " codeQLQueryHistory.viewAutofixes" ,
1305+ "group" : " 1_queryHistory@2" ,
1306+ "when" : " viewItem == remoteResultsItem"
1307+ },
12991308 {
13001309 "command" : " codeQLQueries.runLocalQueryFromQueriesPanel" ,
13011310 "group" : " inline" ,
17061715 "command" : " codeQLQueryHistory.copyRepoList" ,
17071716 "when" : " false"
17081717 },
1718+ {
1719+ "command" : " codeQLQueryHistory.viewAutofixes" ,
1720+ "when" : " false"
1721+ },
17091722 {
17101723 "command" : " codeQLQueryHistory.showQueryText" ,
17111724 "when" : " false"
Original file line number Diff line number Diff line change @@ -197,6 +197,7 @@ export type QueryHistoryCommands = {
197197 "codeQLQueryHistory.itemClicked" : TreeViewContextMultiSelectionCommandFunction < QueryHistoryInfo > ;
198198 "codeQLQueryHistory.openOnGithub" : TreeViewContextMultiSelectionCommandFunction < QueryHistoryInfo > ;
199199 "codeQLQueryHistory.copyRepoList" : TreeViewContextMultiSelectionCommandFunction < QueryHistoryInfo > ;
200+ "codeQLQueryHistory.viewAutofixes" : TreeViewContextMultiSelectionCommandFunction < QueryHistoryInfo > ;
200201
201202 // Commands in the command palette
202203 "codeQL.exportSelectedVariantAnalysisResults" : ( ) => Promise < void > ;
Original file line number Diff line number Diff line change @@ -338,6 +338,11 @@ export class QueryHistoryManager extends DisposableObject {
338338 this . handleOpenOnGithub . bind ( this ) ,
339339 "query" ,
340340 ) ,
341+ "codeQLQueryHistory.viewAutofixes" : createSingleSelectionCommand (
342+ this . app . logger ,
343+ this . handleViewAutofixes . bind ( this ) ,
344+ "query" ,
345+ ) ,
341346 "codeQLQueryHistory.copyRepoList" : createSingleSelectionCommand (
342347 this . app . logger ,
343348 this . handleCopyRepoList . bind ( this ) ,
@@ -1052,6 +1057,14 @@ export class QueryHistoryManager extends DisposableObject {
10521057 ) ;
10531058 }
10541059
1060+ async handleViewAutofixes ( item : QueryHistoryInfo ) {
1061+ if ( item . t !== "variant-analysis" ) {
1062+ return ;
1063+ }
1064+
1065+ await this . variantAnalysisManager . viewAutofixes ( item . variantAnalysis . id ) ;
1066+ }
1067+
10551068 async handleCopyRepoList ( item : QueryHistoryInfo ) {
10561069 if ( item . t !== "variant-analysis" ) {
10571070 return ;
Original file line number Diff line number Diff line change @@ -967,7 +967,11 @@ export class VariantAnalysisManager
967967 ) ;
968968 }
969969
970- public async viewAutofixes ( ) {
970+ public async viewAutofixes ( variantAnalysisId : number ) {
971+ const variantAnalysis = this . variantAnalyses . get ( variantAnalysisId ) ;
972+ if ( ! variantAnalysis ) {
973+ throw new Error ( `No variant analysis with id: ${ variantAnalysisId } ` ) ;
974+ }
971975 // TODO
972976 }
973977
You can’t perform that action at this time.
0 commit comments