@@ -27,9 +27,7 @@ export class QueriesModule extends DisposableObject {
2727 }
2828
2929 public getCommands ( ) : QueriesPanelCommands {
30- if ( ! isCanary ( ) || ! showQueriesPanel ( ) ) {
31- // Currently, we only want to expose the new panel when we are in development and canary mode
32- // and the developer has enabled the "Show queries panel" flag.
30+ if ( ! this . shouldInitializeQueriesPanel ) {
3331 return { } as any as QueriesPanelCommands ;
3432 }
3533
@@ -43,9 +41,7 @@ export class QueriesModule extends DisposableObject {
4341 }
4442
4543 private initialize ( app : App , cliServer : CodeQLCliServer ) : void {
46- if ( ! isCanary ( ) || ! showQueriesPanel ( ) ) {
47- // Currently, we only want to expose the new panel when we are in canary mode
48- // and the user has enabled the "Show queries panel" flag.
44+ if ( ! this . shouldInitializeQueriesPanel ) {
4945 return ;
5046 }
5147 void extLogger . log ( "Initializing queries panel." ) ;
@@ -64,4 +60,10 @@ export class QueriesModule extends DisposableObject {
6460 this . queriesPanel = new QueriesPanel ( app , queryDiscovery ) ;
6561 this . push ( this . queriesPanel ) ;
6662 }
63+
64+ private shouldInitializeQueriesPanel ( ) : boolean {
65+ // Currently, we only want to expose the new panel when we are in canary mode
66+ // and the user has enabled the "Show queries panel" flag.
67+ return isCanary ( ) && showQueriesPanel ( ) ;
68+ }
6769}
0 commit comments