From b9473a4e28f6c592efe8a40e3f0b30e52690e188 Mon Sep 17 00:00:00 2001 From: JoshwinThomasIBM Date: Mon, 25 Nov 2024 11:44:55 +0530 Subject: [PATCH] calling handleWorkspaceSaveInProgress from activate --- src/extension.ts | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/extension.ts b/src/extension.ts index 4c777888..5236345b 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -63,7 +63,7 @@ export async function activate(context: vscode.ExtensionContext): Promise item.text = localize("liberty.ls.thumbs.up"); item.tooltip = localize("liberty.ls.started"); toggleItem(window.activeTextEditor, item); - + handleWorkspaceSaveInProgress(getProjectProvider(context)); registerCommands(context); }, (error: any) => { console.log("Liberty client was not ready. Did not initialize"); @@ -105,13 +105,7 @@ function bindRequest(request: string) { } function registerCommands(context: ExtensionContext) { - let projectProvider = ProjectProvider.getInstance(); - if ( !projectProvider ) { - projectProvider = new ProjectProvider(context); - ProjectProvider.setInstance(projectProvider); - } - - handleWorkspaceSaveInProgress(projectProvider); + let projectProvider = getProjectProvider(context); if (vscode.workspace.workspaceFolders !== undefined) { registerFileWatcher(projectProvider); @@ -267,4 +261,13 @@ function handleWorkspaceSaveInProgress(projectProvider: ProjectProvider) { devCommands.addProjectsToTheDashBoard(projectProvider, projectProvider.getContext().globalState.get('selectedProject') as string); helperUtil.clearDataSavedInGlobalState(projectProvider.getContext()); } +} + +function getProjectProvider(context: vscode.ExtensionContext) : ProjectProvider{ + let projectProvider = ProjectProvider.getInstance(); + if ( !projectProvider ) { + projectProvider = new ProjectProvider(context); + ProjectProvider.setInstance(projectProvider); + } + return projectProvider; } \ No newline at end of file