vscode: reordered config constructor before methods
This commit is contained in:
@@ -26,16 +26,17 @@ export class Config {
|
|||||||
|
|
||||||
private cfg!: vscode.WorkspaceConfiguration;
|
private cfg!: vscode.WorkspaceConfiguration;
|
||||||
|
|
||||||
|
constructor(private readonly ctx: vscode.ExtensionContext) {
|
||||||
|
vscode.workspace.onDidChangeConfiguration(this.onConfigChange, this, ctx.subscriptions);
|
||||||
|
this.refreshConfig();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private refreshConfig() {
|
private refreshConfig() {
|
||||||
this.cfg = vscode.workspace.getConfiguration(Config.rootSection);
|
this.cfg = vscode.workspace.getConfiguration(Config.rootSection);
|
||||||
console.log("Using configuration:", this.cfg);
|
console.log("Using configuration:", this.cfg);
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor(private ctx: vscode.ExtensionContext) {
|
|
||||||
vscode.workspace.onDidChangeConfiguration(this.onConfigChange, this, ctx.subscriptions);
|
|
||||||
this.refreshConfig();
|
|
||||||
}
|
|
||||||
|
|
||||||
async onConfigChange(event: vscode.ConfigurationChangeEvent) {
|
async onConfigChange(event: vscode.ConfigurationChangeEvent) {
|
||||||
this.refreshConfig();
|
this.refreshConfig();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user