Merge pull request #188982 from microsoft/kartik/detailed-tahr

Fix for each in scope env collection
This commit is contained in:
Kartik Raj 2023-07-26 14:32:34 -07:00 committed by GitHub
commit 1ca9aa71bb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View file

@ -936,6 +936,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

@ -992,9 +992,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;