configurationService.ts ×6

Frontier kind: Code frontier

unlabeled · c_36e51893878e

7 tests · 15586 LOC · 74 files · introduces 0 tests · 16 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
8 ranges16 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
2429 ranges15586 lines · 74 files · Browse complete extent
All tests (intent)
7 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.

2 files ranked by introduced lines: 16 introduced LOC across 8 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/platform/configuration/common/configurationService.ts 13 introduced LOC · 6 ranges

Open complete file

105 updateValue(key: string, value: unknown, overrides: IConfigurationOverrides | IConfigurationUpdateOverrides, target: ConfigurationTarget, options?: IConfigurationUpdateOptions): Promise<void>;
106 async updateValue(key: string, value: unknown, arg3?: unknown, arg4?: unknown, options?: IConfigurationUpdateOptions): Promise<void> {
107 > const overrides: IConfigurationUpdateOverrides | undefined = isConfigurationUpdateOverrides(arg3) ? arg3 configurationService.ts
108 > : isConfigurationOverrides(arg3) ? { resource: arg3.resource, overrideIdentifiers: arg3.overrideIdentifier ? [arg3.overrideIdentifier] : undefined } : undefined;
109 >
110 > const target: ConfigurationTarget | undefined = (overrides ? arg4 : arg3) as ConfigurationTarget | undefined;
111 > if (target !== undefined) {
112 if (target !== ConfigurationTarget.USER_LOCAL && target !== ConfigurationTarget.USER) {
113 throw new Error(`Unable to write ${key} to target ${target}.`);
115 }
116
117 > if (overrides?.overrideIdentifiers) { configurationService.ts
118 overrides.overrideIdentifiers = distinct(overrides.overrideIdentifiers);
119 overrides.overrideIdentifiers = overrides.overrideIdentifiers.length ? overrides.overrideIdentifiers : undefined;
120 }
121
122 > const inspect = this.inspect(key, { resource: overrides?.resource, overrideIdentifier: overrides?.overrideIdentifiers ? overrides.overrideIdentifiers[0] : undefined }); configurationService.ts
123 > if (inspect.policyValue !== undefined) {
124 throw new Error(`Unable to write ${key} because it is configured in system policy.`);
125 }
130 }
131
132 > if (overrides?.overrideIdentifiers?.length && overrides.overrideIdentifiers.length > 1) { configurationService.ts
133 const overrideIdentifiers = overrides.overrideIdentifiers.sort();
134 const existingOverrides = this.configuration.localUserConfiguration.overrides.find(override => arrayEquals([...override.identifiers].sort(), overrideIdentifiers));
138 }
139
140 > const path = overrides?.overrideIdentifiers?.length ? [keyFromOverrideIdentifiers(overrides.overrideIdentifiers), key] : [key]; configurationService.ts
141 >
142 > await this.configurationEditing.write(path, value);
143 await this.reloadConfiguration();
145
146 inspect<T>(key: string, overrides: IConfigurationOverrides = {}): IConfigurationValue<T> {
src/vs/platform/configuration/common/configuration.ts 3 introduced LOC · 2 ranges

Open complete file

28
29 export function isConfigurationUpdateOverrides(obj: unknown): obj is IConfigurationUpdateOverrides {
30 > const thing = obj as IConfigurationUpdateOverrides | IConfigurationOverrides; configuration.ts
31 > return thing
32 && typeof thing === 'object'
33 && (!(thing as IConfigurationUpdateOverrides).overrideIdentifiers || Array.isArray((thing as IConfigurationUpdateOverrides).overrideIdentifiers))
34 && !(thing as IConfigurationOverrides).overrideIdentifier
35 && (!thing.resource || thing.resource instanceof URI);
37
38 export type IConfigurationUpdateOverrides = Omit<IConfigurationOverrides, 'overrideIdentifier'> & { overrideIdentifiers?: string[] | null };