environmentVariable.ts ×1

Frontier kind: Code frontier

unlabeled · c_a0e96f3a7bd4

1085 tests · 3491 LOC · 20 files · introduces 0 tests · 93 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
1 range93 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
487 ranges3491 lines · 20 files · Browse complete extent
All tests (intent)
1085 testsBrowse complete intent

Neighbourhood graph

The orange circle is the focus. Violet and green circles are every ancestor and descendant, broader and narrower, at any distance; blue squares and pink diamonds are the introduced files and exact introduced tests of every visible concept, not only the focus's. Arrows point from broader to narrower concepts and bridge only concepts omitted from this view. Undirected links show source or test introduction. Concept and file size follows LOC; exact test nodes use test-count units.

Introduced files, introduced tests, and structurally relevant concept specialization

In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the native relationship evidence on this page.

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the native relationship evidence on this page while the interactive map is unavailable.

Native relationship evidence

Every exact file and test below is linked only from the concept that introduces it.

Introduced tests

Every collected test enters the hierarchy at exactly one concept.

No tests are introduced at this concept. Its intent tests are introduced by other concepts.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

1 file ranked by introduced lines: 93 introduced LOC across 1 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/platform/terminal/common/environmentVariable.ts 93 introduced LOC · 1 range

Open complete file

1 > /*--------------------------------------------------------------------------------------------- environmentVariable.ts
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 } from '../../../base/common/platform.js';
7 > import { IWorkspaceFolderData } from '../../workspace/common/workspace.js';
8 >
9 > export enum EnvironmentVariableMutatorType {
10 > Replace = 1,
11 > Append = 2,
12 > Prepend = 3
13 > }
14 > export interface IEnvironmentVariableMutator {
15 > readonly variable: string;
16 > readonly value: string;
17 > readonly type: EnvironmentVariableMutatorType;
18 > readonly scope?: EnvironmentVariableScope;
19 > readonly options?: IEnvironmentVariableMutatorOptions;
20 > }
21 >
22 > export interface IEnvironmentVariableCollectionDescription {
23 > readonly description: string | undefined;
24 > readonly scope?: EnvironmentVariableScope;
25 > }
26 >
27 > export interface IEnvironmentVariableMutatorOptions {
28 > applyAtProcessCreation?: boolean;
29 > applyAtShellIntegration?: boolean;
30 > }
31 >
32 > export type EnvironmentVariableScope = {
33 > workspaceFolder?: IWorkspaceFolderData;
34 > };
35 >
36 > export interface IEnvironmentVariableCollection {
37 > readonly map: ReadonlyMap<string, IEnvironmentVariableMutator>;
38 > readonly descriptionMap?: ReadonlyMap<string, IEnvironmentVariableCollectionDescription>;
39 > }
40 >
41 > /** [variable, mutator] */
42 > export type ISerializableEnvironmentVariableCollection = [string, IEnvironmentVariableMutator][];
43 >
44 > export type ISerializableEnvironmentDescriptionMap = [string, IEnvironmentVariableCollectionDescription][];
45 > export interface IExtensionOwnedEnvironmentDescriptionMutator extends IEnvironmentVariableCollectionDescription {
46 > readonly extensionIdentifier: string;
47 > }
48 >
49 > /** [extension, collection, description] */
50 > export type ISerializableEnvironmentVariableCollections = [string, ISerializableEnvironmentVariableCollection, ISerializableEnvironmentDescriptionMap][];
51 >
52 > export interface IExtensionOwnedEnvironmentVariableMutator extends IEnvironmentVariableMutator {
53 > readonly extensionIdentifier: string;
54 > }
55 >
56 > export interface IMergedEnvironmentVariableCollectionDiff {
57 > added: ReadonlyMap<string, IExtensionOwnedEnvironmentVariableMutator[]>;
58 > changed: ReadonlyMap<string, IExtensionOwnedEnvironmentVariableMutator[]>;
59 > removed: ReadonlyMap<string, IExtensionOwnedEnvironmentVariableMutator[]>;
60 > }
61 >
62 > type VariableResolver = (str: string) => Promise<string>;
63 >
64 > /**
65 > * Represents an environment variable collection that results from merging several collections
66 > * together.
67 > */
68 > export interface IMergedEnvironmentVariableCollection {
69 > readonly collections: ReadonlyMap<string, IEnvironmentVariableCollection>;
70 > /**
71 > * Gets the variable map for a given scope.
72 > * @param scope The scope to get the variable map for. If undefined, the global scope is used.
73 > */
74 > getVariableMap(scope: EnvironmentVariableScope | undefined): Map<string, IExtensionOwnedEnvironmentVariableMutator[]>;
75 > /**
76 > * Gets the description map for a given scope.
77 > * @param scope The scope to get the description map for. If undefined, description map for the
78 > * global scope is returned.
79 > */
80 > getDescriptionMap(scope: EnvironmentVariableScope | undefined): Map<string, string | undefined>;
81 > /**
82 > * Applies this collection to a process environment.
83 > * @param variableResolver An optional function to use to resolve variables within the
84 > * environment values.
85 > */
86 > applyToProcessEnvironment(env: IProcessEnvironment, scope: EnvironmentVariableScope | undefined, variableResolver?: VariableResolver): Promise<void>;
87 >
88 > /**
89 > * Generates a diff of this collection against another. Returns undefined if the collections are
90 > * the same.
91 > */
92 > diff(other: IMergedEnvironmentVariableCollection, scope: EnvironmentVariableScope | undefined): IMergedEnvironmentVariableCollectionDiff | undefined;
93 > }