Skip to content

Commit 64ee37a

Browse files
author
Kartik Raj
committed
Change how we get variable map
1 parent db774ad commit 64ee37a

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

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

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -945,14 +945,13 @@ class EnvironmentVariableCollection {
945945
}
946946

947947
public getVariableMap(scope: vscode.EnvironmentVariableScope | undefined): Map<string, IEnvironmentVariableMutator> {
948-
const scopedMap = new Map<string, IEnvironmentVariableMutator>();
949-
const scopeKey = this.getScopeKey(scope);
950-
for (const [key, value] of this.map.entries()) {
951-
if (key === scopeKey) {
952-
scopedMap.set(value.variable, value);
948+
const map = new Map<string, IEnvironmentVariableMutator>();
949+
for (const [key, value] of this.map) {
950+
if (this.getScopeKey(value.scope) === this.getScopeKey(scope)) {
951+
map.set(key, value);
953952
}
954953
}
955-
return scopedMap;
954+
return map;
956955
}
957956

958957
delete(variable: string, scope: vscode.EnvironmentVariableScope | undefined): void {

0 commit comments

Comments
 (0)