Skip to content

Commit

Permalink
calling handleWorkspaceSaveInProgress from activate
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshwinThomasIBM authored and JoshwinThomasIBM committed Nov 25, 2024
1 parent 822f81b commit b9473a4
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export async function activate(context: vscode.ExtensionContext): Promise<void>
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");
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
}

0 comments on commit b9473a4

Please sign in to comment.