Remove member variables that could be local variables

This commit is contained in:
Robert
2023-05-24 10:37:22 +01:00
parent 7ef35af68a
commit 9dee2a132e
2 changed files with 9 additions and 17 deletions

View File

@@ -7,9 +7,6 @@ import { QueriesPanel } from "./queries-panel";
import { QueryDiscovery } from "./query-discovery";
export class QueriesModule extends DisposableObject {
private queriesPanel: QueriesPanel | undefined;
private queryDiscovery: QueryDiscovery | undefined;
private constructor(readonly app: App) {
super();
}
@@ -22,12 +19,12 @@ export class QueriesModule extends DisposableObject {
}
void extLogger.log("Initializing queries panel.");
this.queryDiscovery = new QueryDiscovery(app, cliServer);
this.push(this.queryDiscovery);
this.queryDiscovery.refresh();
const queryDiscovery = new QueryDiscovery(app, cliServer);
this.push(queryDiscovery);
queryDiscovery.refresh();
this.queriesPanel = new QueriesPanel(this.queryDiscovery);
this.push(this.queriesPanel);
const queriesPanel = new QueriesPanel(queryDiscovery);
this.push(queriesPanel);
}
public static initialize(

View File

@@ -1,22 +1,17 @@
import * as vscode from "vscode";
import { DisposableObject } from "../pure/disposable-object";
import { QueryTreeDataProvider } from "./query-tree-data-provider";
import { QueryTreeViewItem } from "./query-tree-view-item";
import { QueryDiscovery } from "./query-discovery";
export class QueriesPanel extends DisposableObject {
private readonly dataProvider: QueryTreeDataProvider;
private readonly treeView: vscode.TreeView<QueryTreeViewItem>;
public constructor(queryDiscovery: QueryDiscovery) {
super();
this.dataProvider = new QueryTreeDataProvider(queryDiscovery);
const dataProvider = new QueryTreeDataProvider(queryDiscovery);
this.treeView = vscode.window.createTreeView("codeQLQueries", {
treeDataProvider: this.dataProvider,
const treeView = vscode.window.createTreeView("codeQLQueries", {
treeDataProvider: dataProvider,
});
this.push(this.treeView);
this.push(treeView);
}
}