remove .name from IWorkspace

This commit is contained in:
isidor
2018-08-23 11:59:51 +02:00
parent 6090860b4f
commit a03b3b5066
29 changed files with 103 additions and 96 deletions

View File

@@ -107,8 +107,8 @@ class ExtHostWorkspaceImpl extends Workspace {
private readonly _workspaceFolders: vscode.WorkspaceFolder[] = [];
private readonly _structure = TernarySearchTree.forPaths<vscode.WorkspaceFolder>();
private constructor(id: string, name: string, folders: vscode.WorkspaceFolder[]) {
super(id, name, folders.map(f => new WorkspaceFolder(f)));
private constructor(id: string, private _name: string, folders: vscode.WorkspaceFolder[]) {
super(id, folders.map(f => new WorkspaceFolder(f)));
// setup the workspace folder data structure
folders.forEach(folder => {
@@ -117,6 +117,10 @@ class ExtHostWorkspaceImpl extends Workspace {
});
}
get name(): string {
return this._name;
}
get workspaceFolders(): vscode.WorkspaceFolder[] {
return this._workspaceFolders.slice(0);
}
@@ -166,6 +170,10 @@ export class ExtHostWorkspace implements ExtHostWorkspaceShape {
return this._actualWorkspace;
}
get name(): string {
return this._actualWorkspace ? this._actualWorkspace.name : undefined;
}
private get _actualWorkspace(): ExtHostWorkspaceImpl {
return this._unconfirmedWorkspace || this._confirmedWorkspace;
}