mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-24 01:25:37 -05:00
Remove awaits that were blocking data workspace extension from loading (#15904)
* remove awaits that were blocking data workspace extension from loading * add comment * remove await and use then * use return instead of await * add notification when there's an error
This commit is contained in:
@@ -18,10 +18,18 @@ import { createNewProjectWithQuickpick } from './dialogs/newProjectQuickpick';
|
||||
|
||||
export async function activate(context: vscode.ExtensionContext): Promise<IExtension> {
|
||||
const workspaceService = new WorkspaceService(context);
|
||||
await workspaceService.loadTempProjects();
|
||||
workspaceService.checkForProjectsNotAddedToWorkspace();
|
||||
context.subscriptions.push(vscode.workspace.onDidChangeWorkspaceFolders(async () => {
|
||||
await workspaceService.checkForProjectsNotAddedToWorkspace();
|
||||
|
||||
// this is not being awaited to not block the rest of activate function from running while loading any temp projects and
|
||||
// checking for projects not added to the workspace yet
|
||||
workspaceService.loadTempProjects().then(() => {
|
||||
return workspaceService.checkForProjectsNotAddedToWorkspace();
|
||||
}).catch(error => {
|
||||
console.error(error);
|
||||
vscode.window.showErrorMessage(error instanceof Error ? error.message : error);
|
||||
});
|
||||
|
||||
context.subscriptions.push(vscode.workspace.onDidChangeWorkspaceFolders(() => {
|
||||
workspaceService.checkForProjectsNotAddedToWorkspace();
|
||||
}));
|
||||
|
||||
const workspaceTreeDataProvider = new WorkspaceTreeDataProvider(workspaceService);
|
||||
|
||||
Reference in New Issue
Block a user