mirror of
https://github.com/Microsoft/vscode
synced 2024-09-18 01:58:27 +00:00
Delete scope property if undefined
This commit is contained in:
parent
9d68cc5532
commit
69e919cc0e
|
@ -39,14 +39,18 @@ export class MergedEnvironmentVariableCollection implements IMergedEnvironmentVa
|
|||
continue;
|
||||
}
|
||||
|
||||
// Mutators get applied in the reverse order than they are created
|
||||
entry.unshift({
|
||||
const extensionMutator = {
|
||||
extensionIdentifier,
|
||||
value: mutator.value,
|
||||
type: mutator.type,
|
||||
scope: mutator.scope,
|
||||
variable: mutator.variable
|
||||
});
|
||||
};
|
||||
if (!extensionMutator.scope) {
|
||||
delete extensionMutator.scope; // Convenient for tests
|
||||
}
|
||||
// Mutators get applied in the reverse order than they are created
|
||||
entry.unshift(extensionMutator);
|
||||
|
||||
next = it.next();
|
||||
}
|
||||
|
|
|
@ -902,6 +902,9 @@ class EnvironmentVariableCollection implements vscode.EnvironmentVariableCollect
|
|||
}
|
||||
|
||||
private _setIfDiffers(variable: string, mutator: vscode.EnvironmentVariableMutator): void {
|
||||
if (!mutator.scope) {
|
||||
delete (mutator as any).scope; // Convenient for tests
|
||||
}
|
||||
const key = this.getKey(variable, mutator.scope);
|
||||
const current = this.map.get(key);
|
||||
if (!current || current.value !== mutator.value || current.type !== mutator.type || current.scope?.workspaceFolder?.index !== mutator.scope?.workspaceFolder?.index) {
|
||||
|
|
Loading…
Reference in a new issue