Files
azuredatastudio/extensions/data-workspace/src/common/dataWorkspaceExtension.ts
Kim Santiago 59ad601664 Make new workspace inputbox editable in Create project from database dialog (#13842)
* update create project from database dialog to have editable new workspace

* add validation

* add test

* add error message

* Remove test for now

* cleanup

* add periods

* throw errors

* change return type to void
2020-12-18 10:24:38 -08:00

36 lines
1.3 KiB
TypeScript

/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as vscode from 'vscode';
import { IExtension } from 'dataworkspace';
import { WorkspaceService } from '../services/workspaceService';
import { defaultProjectSaveLocation } from './projectLocationHelper';
export class DataWorkspaceExtension implements IExtension {
constructor(private workspaceService: WorkspaceService) {
}
getProjectsInWorkspace(): vscode.Uri[] {
return this.workspaceService.getProjectsInWorkspace();
}
addProjectsToWorkspace(projectFiles: vscode.Uri[], workspaceFilePath?: vscode.Uri): Promise<void> {
return this.workspaceService.addProjectsToWorkspace(projectFiles, workspaceFilePath);
}
showProjectsView(): void {
vscode.commands.executeCommand('dataworkspace.views.main.focus');
}
get defaultProjectSaveLocation(): vscode.Uri | undefined {
return defaultProjectSaveLocation();
}
validateWorkspace(): Promise<boolean> {
return this.workspaceService.validateWorkspace();
}
}