Fix for each in scope env collection

This commit is contained in:
Kartik Raj 2023-07-26 20:58:53 +00:00
parent 6243562032
commit 68d22e586d
2 changed files with 3 additions and 2 deletions

View file

@ -897,6 +897,7 @@ import { assertNoRpc, poll } from '../utils';
{ value: 'scoped~b2~', type: EnvironmentVariableMutatorType.Append, options: defaultOptions },
{ value: 'scoped~c2~', type: EnvironmentVariableMutatorType.Prepend, options: defaultOptions }
]);
deepStrictEqual(entries.map(v => v[0]), ['A', 'B', 'C']);
});
});
});

View file

@ -980,9 +980,9 @@ class UnifiedEnvironmentVariableCollection {
public getVariableMap(scope: vscode.EnvironmentVariableScope | undefined): Map<string, vscode.EnvironmentVariableMutator> {
const map = new Map<string, vscode.EnvironmentVariableMutator>();
for (const [key, value] of this.map) {
for (const [_, value] of this.map) {
if (this.getScopeKey(value.scope) === this.getScopeKey(scope)) {
map.set(key, convertMutator(value));
map.set(value.variable, convertMutator(value));
}
}
return map;