configurationResolver.ts ×2

Frontier kind: Code frontier

unlabeled · c_8a4a93cba342

73 tests · 13231 LOC · 59 files · introduces 0 tests · 114 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
2 ranges114 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
1708 ranges13231 lines · 59 files · Browse complete extent
All tests (intent)
73 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: 114 introduced LOC across 2 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/workbench/services/configurationResolver/common/configurationResolver.ts 114 introduced LOC · 2 ranges

Open complete file

1 > /*--------------------------------------------------------------------------------------------- configurationResolver.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 { IStringDictionary } from '../../../../base/common/collections.js';
7 > import { ErrorNoTelemetry } from '../../../../base/common/errors.js';
8 > import { IProcessEnvironment } from '../../../../base/common/platform.js';
9 > import { ConfigurationTarget } from '../../../../platform/configuration/common/configuration.js';
10 > import { createDecorator } from '../../../../platform/instantiation/common/instantiation.js';
11 > import { IWorkspaceFolderData } from '../../../../platform/workspace/common/workspace.js';
12 > import { ConfigurationResolverExpression } from './configurationResolverExpression.js';
13 >
14 > export const IConfigurationResolverService = createDecorator<IConfigurationResolverService>('configurationResolverService');
15 >
16 > export interface IConfigurationResolverService {
17 > readonly _serviceBrand: undefined;
18 >
19 > /** Variables the resolver is able to resolve. */
20 > readonly resolvableVariables: ReadonlySet<string>;
21 >
22 > resolveWithEnvironment(environment: IProcessEnvironment, folder: IWorkspaceFolderData | undefined, value: string): Promise<string>;
23 >
24 > /**
25 > * Recursively resolves all variables in the given config and returns a copy of it with substituted values.
26 > * Command variables are only substituted if a "commandValueMapping" dictionary is given and if it contains an entry for the command.
27 > */
28 > resolveAsync<T>(folder: IWorkspaceFolderData | undefined, config: T): Promise<T extends ConfigurationResolverExpression<infer R> ? R : T>;
29 >
30 > /**
31 > * Recursively resolves all variables (including commands and user input) in the given config and returns a copy of it with substituted values.
32 > * If a "variables" dictionary (with names -> command ids) is given, command variables are first mapped through it before being resolved.
33 > *
34 > * @param section For example, 'tasks' or 'debug'. Used for resolving inputs.
35 > * @param variables Aliases for commands.
36 > */
37 > resolveWithInteractionReplace(folder: IWorkspaceFolderData | undefined, config: unknown, section?: string, variables?: IStringDictionary<string>, target?: ConfigurationTarget): Promise<any>;
38 >
39 > /**
40 > * Similar to resolveWithInteractionReplace, except without the replace. Returns a map of variables and their resolution.
41 > * Keys in the map will be of the format input:variableName or command:variableName.
42 > */
43 > resolveWithInteraction(folder: IWorkspaceFolderData | undefined, config: unknown, section?: string, variables?: IStringDictionary<string>, target?: ConfigurationTarget): Promise<Map<string, string> | undefined>;
44 >
45 > /**
46 > * Contributes a variable that can be resolved later. Consumers that use resolveAny, resolveWithInteraction,
47 > * and resolveWithInteractionReplace will have contributed variables resolved.
48 > */
49 > contributeVariable(variable: string, resolution: () => Promise<string | undefined>): void;
50 > }
51 >
52 > interface PromptStringInputInfo {
53 > id: string;
54 > type: 'promptString';
55 > description: string;
56 > default?: string;
57 > password?: boolean;
58 > }
59 >
60 > interface PickStringInputInfo {
61 > id: string;
62 > type: 'pickString';
63 > description: string;
64 > options: (string | { value: string; label?: string })[];
65 > default?: string;
66 > }
67 >
68 > interface CommandInputInfo {
69 > id: string;
70 > type: 'command';
71 > command: string;
72 > args?: any;
73 > }
74 >
75 > export type ConfiguredInput = PromptStringInputInfo | PickStringInputInfo | CommandInputInfo;
76 >
77 > export enum VariableKind {
78 > Unknown = 'unknown',
79 >
80 > Env = 'env',
81 > Config = 'config',
82 > Command = 'command',
83 > Input = 'input',
84 > ExtensionInstallFolder = 'extensionInstallFolder',
85 > TaskVar = 'taskVar',
86 >
87 > WorkspaceFolder = 'workspaceFolder',
88 > Cwd = 'cwd',
89 > WorkspaceFolderBasename = 'workspaceFolderBasename',
90 > UserHome = 'userHome',
91 > LineNumber = 'lineNumber',
92 > ColumnNumber = 'columnNumber',
93 > SelectedText = 'selectedText',
94 > File = 'file',
95 > FileWorkspaceFolder = 'fileWorkspaceFolder',
96 > FileWorkspaceFolderBasename = 'fileWorkspaceFolderBasename',
97 > RelativeFile = 'relativeFile',
98 > RelativeFileDirname = 'relativeFileDirname',
99 > FileDirname = 'fileDirname',
100 > FileExtname = 'fileExtname',
101 > FileBasename = 'fileBasename',
102 > FileBasenameNoExtension = 'fileBasenameNoExtension',
103 > FileDirnameBasename = 'fileDirnameBasename',
104 > ExecPath = 'execPath',
105 > ExecInstallFolder = 'execInstallFolder',
106 > PathSeparator = 'pathSeparator',
107 > PathSeparatorAlias = '/'
108 > }
109 >
110 > export const allVariableKinds = Object.values(VariableKind).filter((value): value is VariableKind => typeof value === 'string');
111 >
112 > export class VariableError extends ErrorNoTelemetry {
113 > constructor(public readonly variable: VariableKind, message?: string) {
114 super(message);
115 }