@@ -169,11 +169,28 @@ const extension = extensions.getExtension(extensionId);
169169/**
170170 * Return all commands that are not tied to the more specific managers.
171171 */
172- function getCommands ( ) : BaseCommands {
172+ function getCommands (
173+ cliServer : CodeQLCliServer ,
174+ queryRunner : QueryRunner ,
175+ ) : BaseCommands {
173176 return {
174177 "codeQL.openDocumentation" : async ( ) => {
175178 await env . openExternal ( Uri . parse ( "https://codeql.github.com/docs/" ) ) ;
176179 } ,
180+ "codeQL.restartQueryServer" : async ( ) =>
181+ withProgress (
182+ async ( progress : ProgressCallback , token : CancellationToken ) => {
183+ // We restart the CLI server too, to ensure they are the same version
184+ cliServer . restartCliServer ( ) ;
185+ await queryRunner . restartQueryServer ( progress , token ) ;
186+ void showAndLogInformationMessage ( "CodeQL Query Server restarted." , {
187+ outputLogger : queryServerLogger ,
188+ } ) ;
189+ } ,
190+ {
191+ title : "Restarting Query Server" ,
192+ } ,
193+ ) ,
177194 } ;
178195}
179196
@@ -799,7 +816,7 @@ async function activateWithInstalledDistribution(
799816 void extLogger . log ( "Registering top-level command palette commands." ) ;
800817
801818 const allCommands : AllCommands = {
802- ...getCommands ( ) ,
819+ ...getCommands ( cliServer , qs ) ,
803820 ...qhm . getCommands ( ) ,
804821 ...variantAnalysisManager . getCommands ( ) ,
805822 ...databaseUI . getCommands ( ) ,
@@ -935,23 +952,6 @@ async function activateWithInstalledDistribution(
935952 } ) ,
936953 ) ;
937954
938- ctx . subscriptions . push (
939- commandRunnerWithProgress (
940- "codeQL.restartQueryServer" ,
941- async ( progress : ProgressCallback , token : CancellationToken ) => {
942- // We restart the CLI server too, to ensure they are the same version
943- cliServer . restartCliServer ( ) ;
944- await qs . restartQueryServer ( progress , token ) ;
945- void showAndLogInformationMessage ( "CodeQL Query Server restarted." , {
946- outputLogger : queryServerLogger ,
947- } ) ;
948- } ,
949- {
950- title : "Restarting Query Server" ,
951- } ,
952- ) ,
953- ) ;
954-
955955 ctx . subscriptions . push (
956956 commandRunner ( "codeQL.copyVersion" , async ( ) => {
957957 const text = `CodeQL extension version: ${
0 commit comments