@@ -137,6 +137,11 @@ import { RepositoriesFilterSortStateWithIds } from "./pure/variant-analysis-filt
137137import { DbModule } from "./databases/db-module" ;
138138import { redactableError } from "./pure/errors" ;
139139import { QueryHistoryDirs } from "./query-history/query-history-dirs" ;
140+ import {
141+ AllCommands ,
142+ ExtensionCommands ,
143+ initializeVSCodeCommandManager ,
144+ } from "./commands" ;
140145
141146/**
142147 * extension.ts
@@ -168,6 +173,16 @@ let isInstallingOrUpdatingDistribution = false;
168173const extensionId = "GitHub.vscode-codeql" ;
169174const extension = extensions . getExtension ( extensionId ) ;
170175
176+ function getCommands (
177+ variantAnalysisManager : VariantAnalysisManager ,
178+ ) : ExtensionCommands {
179+ return {
180+ "codeQL.openVariantAnalysisLogs" : async ( variantAnalysisId : number ) => {
181+ await variantAnalysisManager . openVariantAnalysisLogs ( variantAnalysisId ) ;
182+ } ,
183+ } ;
184+ }
185+
171186/**
172187 * If the user tries to execute vscode commands after extension activation is failed, give
173188 * a sensible error message.
@@ -1153,6 +1168,7 @@ async function activateWithInstalledDistribution(
11531168 ) ,
11541169 ) ;
11551170
1171+ /*
11561172 ctx.subscriptions.push(
11571173 commandRunner(
11581174 "codeQL.openVariantAnalysisLogs",
@@ -1161,6 +1177,17 @@ async function activateWithInstalledDistribution(
11611177 },
11621178 ),
11631179 );
1180+ */
1181+
1182+ const vsCommandRunner = initializeVSCodeCommandManager < AllCommands > ( ) ;
1183+ ctx . subscriptions . push ( vsCommandRunner ) ;
1184+ const allCommands : Partial < AllCommands > = {
1185+ ...getCommands ( variantAnalysisManager ) ,
1186+ } ;
1187+
1188+ for ( const [ commandName , command ] of Object . entries ( allCommands ) ) {
1189+ vsCommandRunner . registerCommand ( commandName as keyof AllCommands , command ) ;
1190+ }
11641191
11651192 ctx . subscriptions . push (
11661193 commandRunner (
0 commit comments