@@ -101,7 +101,6 @@ import {
101101 handleInstallPackDependencies ,
102102} from "./packaging" ;
103103import { HistoryItemLabelProvider } from "./query-history/history-item-label-provider" ;
104- import { exportSelectedVariantAnalysisResults } from "./variant-analysis/export-results" ;
105104import { EvalLogViewer } from "./eval-log-viewer" ;
106105import { SummaryLanguageSupport } from "./log-insights/summary-language-support" ;
107106import { JoinOrderScannerProvider } from "./log-insights/join-order" ;
@@ -164,11 +163,28 @@ const extension = extensions.getExtension(extensionId);
164163/**
165164 * Return all commands that are not tied to the more specific managers.
166165 */
167- function getCommands ( ) : BaseCommands {
166+ function getCommands (
167+ cliServer : CodeQLCliServer ,
168+ queryRunner : QueryRunner ,
169+ ) : BaseCommands {
168170 return {
169171 "codeQL.openDocumentation" : async ( ) => {
170172 await env . openExternal ( Uri . parse ( "https://codeql.github.com/docs/" ) ) ;
171173 } ,
174+ "codeQL.restartQueryServer" : async ( ) =>
175+ withProgress (
176+ async ( progress : ProgressCallback , token : CancellationToken ) => {
177+ // We restart the CLI server too, to ensure they are the same version
178+ cliServer . restartCliServer ( ) ;
179+ await queryRunner . restartQueryServer ( progress , token ) ;
180+ void showAndLogInformationMessage ( "CodeQL Query Server restarted." , {
181+ outputLogger : queryServerLogger ,
182+ } ) ;
183+ } ,
184+ {
185+ title : "Restarting Query Server" ,
186+ } ,
187+ ) ,
172188 } ;
173189}
174190
@@ -794,11 +810,12 @@ async function activateWithInstalledDistribution(
794810 void extLogger . log ( "Registering top-level command palette commands." ) ;
795811
796812 const allCommands : AllCommands = {
797- ...getCommands ( ) ,
813+ ...getCommands ( cliServer , qs ) ,
798814 ...qhm . getCommands ( ) ,
799815 ...variantAnalysisManager . getCommands ( ) ,
800816 ...databaseUI . getCommands ( ) ,
801817 ...dbModule . getCommands ( ) ,
818+ ...evalLogViewer . getCommands ( ) ,
802819 } ;
803820
804821 for ( const [ commandName , command ] of Object . entries ( allCommands ) ) {
@@ -825,12 +842,6 @@ async function activateWithInstalledDistribution(
825842 ) ;
826843 }
827844
828- ctx . subscriptions . push (
829- commandRunner ( "codeQL.exportSelectedVariantAnalysisResults" , async ( ) => {
830- await exportSelectedVariantAnalysisResults ( variantAnalysisManager , qhm ) ;
831- } ) ,
832- ) ;
833-
834845 ctx . subscriptions . push (
835846 commandRunner ( "codeQL.openReferencedFile" , async ( selectedQuery : Uri ) => {
836847 await openReferencedFile ( qs , cliServer , selectedQuery ) ;
@@ -863,23 +874,6 @@ async function activateWithInstalledDistribution(
863874 } ) ,
864875 ) ;
865876
866- ctx . subscriptions . push (
867- commandRunnerWithProgress (
868- "codeQL.restartQueryServer" ,
869- async ( progress : ProgressCallback , token : CancellationToken ) => {
870- // We restart the CLI server too, to ensure they are the same version
871- cliServer . restartCliServer ( ) ;
872- await qs . restartQueryServer ( progress , token ) ;
873- void showAndLogInformationMessage ( "CodeQL Query Server restarted." , {
874- outputLogger : queryServerLogger ,
875- } ) ;
876- } ,
877- {
878- title : "Restarting Query Server" ,
879- } ,
880- ) ,
881- ) ;
882-
883877 ctx . subscriptions . push (
884878 commandRunner ( "codeQL.copyVersion" , async ( ) => {
885879 const text = `CodeQL extension version: ${
0 commit comments