Skip to content

Commit 0874a6a

Browse files
author
Kartik Raj
committed
Do not use spread
1 parent affca3b commit 0874a6a

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

src/vs/workbench/api/common/extHostTerminalService.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -829,12 +829,7 @@ export abstract class BaseExtHostTerminalService extends Disposable implements I
829829
collection = new EnvironmentVariableCollection();
830830
this._setEnvironmentVariableCollection(extension.identifier.value, collection);
831831
}
832-
return {
833-
...collection.getScopedEnvironmentVariableCollection(undefined),
834-
getScopedEnvironmentVariableCollection(scope) {
835-
return collection!.getScopedEnvironmentVariableCollection(scope);
836-
},
837-
};
832+
return collection.getScopedEnvironmentVariableCollection(undefined);
838833
}
839834

840835
private _syncEnvironmentVariableCollection(extensionIdentifier: string, collection: EnvironmentVariableCollection): void {
@@ -893,7 +888,7 @@ class EnvironmentVariableCollection {
893888
this.map = new Map(serialized);
894889
}
895890

896-
getScopedEnvironmentVariableCollection(scope: vscode.EnvironmentVariableScope | undefined): vscode.EnvironmentVariableCollection {
891+
getScopedEnvironmentVariableCollection(scope: vscode.EnvironmentVariableScope | undefined): IDefaultEnvironmentVariableCollection {
897892
const scopedCollectionKey = this.getScopeKey(scope);
898893
let scopedCollection = this.scopedCollections.get(scopedCollectionKey);
899894
if (!scopedCollection) {
@@ -1009,7 +1004,7 @@ class EnvironmentVariableCollection {
10091004
}
10101005
}
10111006

1012-
class ScopedEnvironmentVariableCollection implements vscode.EnvironmentVariableCollection {
1007+
class ScopedEnvironmentVariableCollection implements vscode.EnvironmentVariableCollection, IDefaultEnvironmentVariableCollection {
10131008
public get persistent(): boolean { return this.collection.persistent; }
10141009
public set persistent(value: boolean) {
10151010
this.collection.persistent = value;
@@ -1024,6 +1019,10 @@ class ScopedEnvironmentVariableCollection implements vscode.EnvironmentVariableC
10241019
) {
10251020
}
10261021

1022+
getScopedEnvironmentVariableCollection() {
1023+
return this.collection.getScopedEnvironmentVariableCollection(this.scope);
1024+
}
1025+
10271026
replace(variable: string, value: string): void {
10281027
this.collection.replace(variable, value, this.scope);
10291028
}

0 commit comments

Comments
 (0)