Revert "use IWorkspaceEditingServce to add workspace folder, support to store uris in the workspace file"

This reverts commit 89c4a713f7.
This commit is contained in:
Johannes Rieken
2017-09-20 12:24:30 +02:00
parent 89c4a713f7
commit dd86c6f9ca
12 changed files with 82 additions and 125 deletions

View File

@@ -12,7 +12,7 @@ import { IDisposable, dispose } from 'vs/base/common/lifecycle';
import Event, { Emitter } from 'vs/base/common/event';
import { extHostNamedCustomer } from 'vs/workbench/api/electron-browser/extHostCustomers';
import { IProgress } from 'vs/platform/progress/common/progress';
import { IWorkspaceEditingService } from 'vs/workbench/services/workspace/common/workspaceEditing';
import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace';
@extHostNamedCustomer(MainContext.MainThreadFileSystem)
export class MainThreadFileSystem implements MainThreadFileSystemShape {
@@ -24,7 +24,7 @@ export class MainThreadFileSystem implements MainThreadFileSystemShape {
constructor(
extHostContext: IExtHostContext,
@IFileService private readonly _fileService: IFileService,
@IWorkspaceEditingService private readonly _workspaceEditService: IWorkspaceEditingService
@IWorkspaceContextService private readonly _workspaceEditService: IWorkspaceContextService
) {
this._proxy = extHostContext.get(ExtHostContext.ExtHostFileSystem);
}
@@ -43,7 +43,16 @@ export class MainThreadFileSystem implements MainThreadFileSystemShape {
}
$onDidAddFileSystemRoot(uri: URI): void {
this._workspaceEditService.addFolders([uri]);
const folders = this._workspaceEditService.getWorkspace().folders.slice(0);
folders.push({
uri,
name: uri.authority,
index: folders.length,
raw: null
});
(<any>this._workspaceEditService.getWorkspace()).folders = folders;
(<any>this._workspaceEditService).onFoldersChanged();
(<any>this._workspaceEditService)._onDidChangeWorkspaceFolders.fire(null);
}
$onFileSystemChange(handle: number, changes: IFileChange[]): void {