2
>
* Copyright (c) Microsoft Corporation. All rights reserved.
3
>
* Licensed under the MIT License. See License.txt in the project root for license information.
4
>
*--------------------------------------------------------------------------------------------*/
5
>
6
>
import { IProcessEnvironment, isWindows } from '../../../base/common/platform.js';
7
>
import { EnvironmentVariableMutatorType, EnvironmentVariableScope, IEnvironmentVariableCollection, IExtensionOwnedEnvironmentDescriptionMutator, IExtensionOwnedEnvironmentVariableMutator, IMergedEnvironmentVariableCollection, IMergedEnvironmentVariableCollectionDiff } from './environmentVariable.js';
8
>
9
>
type VariableResolver = (str: string) => Promise<string>;
10
>
11
>
const mutatorTypeToLabelMap: Map<EnvironmentVariableMutatorType, string> = new Map([
12
>
[EnvironmentVariableMutatorType.Append, 'APPEND'],
13
>
[EnvironmentVariableMutatorType.Prepend, 'PREPEND'],
14
>
[EnvironmentVariableMutatorType.Replace, 'REPLACE']
15
>
]);
16
>
const PYTHON_ACTIVATION_VARS_PATTERN = /^VSCODE_PYTHON_(PWSH|ZSH|BASH|FISH)_ACTIVATE/;
17
>
const PYTHON_ENV_EXTENSION_ID = 'ms-python.vscode-python-envs';
18
>
19
>
export class MergedEnvironmentVariableCollection implements IMergedEnvironmentVariableCollection {
20
>
private readonly map: Map<string, IExtensionOwnedEnvironmentVariableMutator[]> = new Map();
21
>
private readonly descriptionMap: Map<string, IExtensionOwnedEnvironmentDescriptionMutator[]> = new Map();
22
>
23
>
constructor(
24
readonly collections: ReadonlyMap<string, IEnvironmentVariableCollection>,
25
) {