mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-18 01:25:37 -05:00
Fix how data workspace handles untitled workspaces (#14505)
* add more workspace apis * update dialog and check workspace scheme * cleanup * add comment * update create project from db dialog * cleanup * update names * add test
This commit is contained in:
@@ -9,18 +9,20 @@ import { extHostNamedCustomer } from 'vs/workbench/api/common/extHostCustomers';
|
||||
import { Disposable } from 'vs/base/common/lifecycle';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { IWorkspaceEditingService } from 'vs/workbench/services/workspaces/common/workspaceEditing';
|
||||
import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
|
||||
|
||||
@extHostNamedCustomer(SqlMainContext.MainThreadWorkspace)
|
||||
export class MainThreadWorkspace extends Disposable implements MainThreadWorkspaceShape {
|
||||
|
||||
constructor(
|
||||
extHostContext: IExtHostContext,
|
||||
@IWorkspaceEditingService private workspaceEditingService: IWorkspaceEditingService
|
||||
@IWorkspaceEditingService private workspaceEditingService: IWorkspaceEditingService,
|
||||
@IWorkbenchEnvironmentService protected readonly environmentService: IWorkbenchEnvironmentService,
|
||||
) {
|
||||
super();
|
||||
}
|
||||
|
||||
$createWorkspace(folder: URI, workspaceFile?: URI): Promise<void> {
|
||||
$createAndEnterWorkspace(folder: URI, workspaceFile?: URI): Promise<void> {
|
||||
folder = URI.revive(folder);
|
||||
workspaceFile = URI.revive(workspaceFile);
|
||||
return this.workspaceEditingService.createAndEnterWorkspace([{ uri: folder }], workspaceFile);
|
||||
@@ -30,4 +32,10 @@ export class MainThreadWorkspace extends Disposable implements MainThreadWorkspa
|
||||
workspaceFile = URI.revive(workspaceFile);
|
||||
return this.workspaceEditingService.enterWorkspace(workspaceFile);
|
||||
}
|
||||
|
||||
$saveAndEnterWorkspace(workspaceFile: URI): Promise<void> {
|
||||
workspaceFile = URI.revive(workspaceFile);
|
||||
return this.workspaceEditingService.saveAndEnterWorkspace(workspaceFile);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user