@@ -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
@@ -1097,7 +1114,7 @@ async function activateWithInstalledDistribution(
10971114 ) ;
10981115
10991116 const allCommands : AllCommands = {
1100- ...getCommands ( ) ,
1117+ ...getCommands ( cliServer , qs ) ,
11011118 ...qhm . getCommands ( ) ,
11021119 ...variantAnalysisManager . getCommands ( ) ,
11031120 ...databaseUI . getCommands ( ) ,
@@ -1212,24 +1229,6 @@ async function activateWithInstalledDistribution(
12121229 } ) ,
12131230 ) ;
12141231
1215- ctx . subscriptions . push (
1216- commandRunner ( "codeQL.restartQueryServer" , async ( ) =>
1217- withProgress (
1218- async ( progress : ProgressCallback , token : CancellationToken ) => {
1219- // We restart the CLI server too, to ensure they are the same version
1220- cliServer . restartCliServer ( ) ;
1221- await qs . restartQueryServer ( progress , token ) ;
1222- void showAndLogInformationMessage ( "CodeQL Query Server restarted." , {
1223- outputLogger : queryServerLogger ,
1224- } ) ;
1225- } ,
1226- {
1227- title : "Restarting Query Server" ,
1228- } ,
1229- ) ,
1230- ) ,
1231- ) ;
1232-
12331232 ctx . subscriptions . push (
12341233 commandRunnerWithProgress (
12351234 "codeQL.chooseDatabaseFolder" ,
0 commit comments