@@ -136,6 +136,7 @@ import { RepositoriesFilterSortStateWithIds } from "./pure/variant-analysis-filt
136136import { DbModule } from "./databases/db-module" ;
137137import { redactableError } from "./pure/errors" ;
138138import { QueryHistoryDirs } from "./query-history/query-history-dirs" ;
139+ import { AllCommands , BaseCommands } from "./common/commands" ;
139140
140141/**
141142 * extension.ts
@@ -167,6 +168,17 @@ let isInstallingOrUpdatingDistribution = false;
167168const extensionId = "GitHub.vscode-codeql" ;
168169const extension = extensions . getExtension ( extensionId ) ;
169170
171+ /**
172+ * Return all commands that are not tied to the more specific managers.
173+ */
174+ function getCommands ( ) : BaseCommands {
175+ return {
176+ "codeQL.openDocumentation" : async ( ) => {
177+ await env . openExternal ( Uri . parse ( "https://codeql.github.com/docs/" ) ) ;
178+ } ,
179+ } ;
180+ }
181+
170182/**
171183 * If the user tries to execute vscode commands after extension activation is failed, give
172184 * a sensible error message.
@@ -1191,14 +1203,14 @@ async function activateWithInstalledDistribution(
11911203 ) ,
11921204 ) ;
11931205
1194- ctx . subscriptions . push (
1195- commandRunner (
1196- "codeQL.openVariantAnalysisLogs" ,
1197- async ( variantAnalysisId : number ) => {
1198- await variantAnalysisManager . openVariantAnalysisLogs ( variantAnalysisId ) ;
1199- } ,
1200- ) ,
1201- ) ;
1206+ const allCommands : AllCommands = {
1207+ ... getCommands ( ) ,
1208+ ... variantAnalysisManager . getCommands ( ) ,
1209+ } ;
1210+
1211+ for ( const [ commandName , command ] of Object . entries ( allCommands ) ) {
1212+ app . commands . register ( commandName as keyof AllCommands , command ) ;
1213+ }
12021214
12031215 ctx . subscriptions . push (
12041216 commandRunner (
@@ -1410,12 +1422,6 @@ async function activateWithInstalledDistribution(
14101422 ) ,
14111423 ) ;
14121424
1413- ctx . subscriptions . push (
1414- commandRunner ( "codeQL.openDocumentation" , async ( ) =>
1415- env . openExternal ( Uri . parse ( "https://codeql.github.com/docs/" ) ) ,
1416- ) ,
1417- ) ;
1418-
14191425 ctx . subscriptions . push (
14201426 commandRunner ( "codeQL.copyVersion" , async ( ) => {
14211427 const text = `CodeQL extension version: ${
0 commit comments