Fix/extension manager init (#442)
* fix: remove init from constructor * fix: add extension manager init to activate
This commit is contained in:
parent
68b1afe566
commit
ebbec3250c
2 changed files with 3 additions and 2 deletions
|
@ -14,6 +14,7 @@ type InstallationType = {
|
|||
};
|
||||
|
||||
export interface IExtensionManager {
|
||||
init: () => Promise<void>;
|
||||
getPackageJSON: () => Record<string, any>;
|
||||
getConfig: () => MaterialThemeConfig;
|
||||
getInstallationType: () => {};
|
||||
|
@ -30,7 +31,6 @@ class ExtensionManager implements IExtensionManager {
|
|||
const extensionFolderUri = Uri.file(extensions.getExtension(MATERIAL_THEME_EXT_ID).extensionPath);
|
||||
this.configFileUri = extensionFolderUri.with({path: posix.join(extensionFolderUri.path, CONFIG_FILE_NAME)});
|
||||
this.userConfigFileUri = extensionFolderUri.with({path: posix.join(extensionFolderUri.path, USER_CONFIG_FILE_NAME)});
|
||||
this.init();
|
||||
}
|
||||
|
||||
getPackageJSON(): Record<string, any> {
|
||||
|
@ -78,7 +78,7 @@ class ExtensionManager implements IExtensionManager {
|
|||
} catch {}
|
||||
}
|
||||
|
||||
private async init(): Promise<void> {
|
||||
async init(): Promise<void> {
|
||||
try {
|
||||
const packageJSON = this.getPackageJSON();
|
||||
const userConfig = await this.getUserConfig();
|
||||
|
|
|
@ -9,6 +9,7 @@ import {changelogManager} from './core/changelog-manager';
|
|||
import {extensionManager} from './core/extension-manager';
|
||||
|
||||
export async function activate(context: ExtensionContext): Promise<void> {
|
||||
await extensionManager.init();
|
||||
const releaseNotesView = new ReleaseNotesWebview(context);
|
||||
const installationType = extensionManager.getInstallationType();
|
||||
|
||||
|
|
Loading…
Reference in a new issue