@@ -6,7 +6,6 @@ import { DisposableObject } from "../common/disposable-object";
66import { QueriesPanel } from "./queries-panel" ;
77import { QueryDiscovery } from "./query-discovery" ;
88import { QueryPackDiscovery } from "./query-pack-discovery" ;
9- import { QueriesPanelCommands } from "../common/commands" ;
109
1110export class QueriesModule extends DisposableObject {
1211 private queriesPanel : QueriesPanel | undefined ;
@@ -26,24 +25,10 @@ export class QueriesModule extends DisposableObject {
2625 return queriesModule ;
2726 }
2827
29- public getCommands ( ) : QueriesPanelCommands {
30- if ( ! this . shouldInitializeQueriesPanel ( ) ) {
31- return {
32- "codeQLQueries.runLocalQueryContextInline" : ( ) => Promise . resolve ( ) ,
33- } ;
34- }
35-
36- if ( ! this . queriesPanel ) {
37- throw new Error ( "Queries panel not initialized" ) ;
38- }
39-
40- return {
41- ...this . queriesPanel . getCommands ( ) ,
42- } ;
43- }
44-
4528 private initialize ( app : App , cliServer : CodeQLCliServer ) : void {
46- if ( ! this . shouldInitializeQueriesPanel ) {
29+ // Currently, we only want to expose the new panel when we are in canary mode
30+ // and the user has enabled the "Show queries panel" flag.
31+ if ( ! isCanary ( ) || ! showQueriesPanel ( ) ) {
4732 return ;
4833 }
4934 void extLogger . log ( "Initializing queries panel." ) ;
@@ -59,13 +44,7 @@ export class QueriesModule extends DisposableObject {
5944 this . push ( queryDiscovery ) ;
6045 void queryDiscovery . initialRefresh ( ) ;
6146
62- this . queriesPanel = new QueriesPanel ( app , queryDiscovery ) ;
47+ this . queriesPanel = new QueriesPanel ( queryDiscovery ) ;
6348 this . push ( this . queriesPanel ) ;
6449 }
65-
66- private shouldInitializeQueriesPanel ( ) : boolean {
67- // Currently, we only want to expose the new panel when we are in canary mode
68- // and the user has enabled the "Show queries panel" flag.
69- return isCanary ( ) && showQueriesPanel ( ) ;
70- }
7150}
0 commit comments