mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Load all data workspace projects directly from workspace (#15921)
* Load all projects directly from workspace * fixes * Remove relativity and fix tests * fix compile * PR comments * remove unused * distro
This commit is contained in:
@@ -17,22 +17,12 @@ import { getAzdataApi } from './common/utils';
|
||||
import { createNewProjectWithQuickpick } from './dialogs/newProjectQuickpick';
|
||||
|
||||
export async function activate(context: vscode.ExtensionContext): Promise<IExtension> {
|
||||
const workspaceService = new WorkspaceService(context);
|
||||
|
||||
// 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 workspaceService = new WorkspaceService();
|
||||
|
||||
const workspaceTreeDataProvider = new WorkspaceTreeDataProvider(workspaceService);
|
||||
context.subscriptions.push(vscode.workspace.onDidChangeWorkspaceFolders(() => {
|
||||
workspaceTreeDataProvider.refresh();
|
||||
}));
|
||||
const dataWorkspaceExtension = new DataWorkspaceExtension(workspaceService);
|
||||
context.subscriptions.push(vscode.window.registerTreeDataProvider('dataworkspace.views.main', workspaceTreeDataProvider));
|
||||
context.subscriptions.push(vscode.extensions.onDidChange(() => {
|
||||
@@ -51,7 +41,7 @@ export async function activate(context: vscode.ExtensionContext): Promise<IExten
|
||||
}));
|
||||
|
||||
context.subscriptions.push(vscode.commands.registerCommand('projects.openExisting', async () => {
|
||||
const dialog = new OpenExistingDialog(workspaceService, context);
|
||||
const dialog = new OpenExistingDialog(workspaceService);
|
||||
await dialog.open();
|
||||
|
||||
}));
|
||||
@@ -64,9 +54,6 @@ export async function activate(context: vscode.ExtensionContext): Promise<IExten
|
||||
vscode.commands.executeCommand('workbench.action.closeFolder');
|
||||
}));
|
||||
|
||||
context.subscriptions.push(vscode.commands.registerCommand('projects.removeProject', async (treeItem: WorkspaceTreeItem) => {
|
||||
await workspaceService.removeProject(vscode.Uri.file(treeItem.element.project.projectFilePath));
|
||||
}));
|
||||
context.subscriptions.push(vscode.commands.registerCommand('projects.manageProject', async (treeItem: WorkspaceTreeItem) => {
|
||||
const dashboard = new ProjectDashboard(workspaceService, treeItem);
|
||||
await dashboard.showDashboard();
|
||||
|
||||
Reference in New Issue
Block a user