configurationModels.ts ×19

Frontier kind: Code frontier

unlabeled · c_f4a25b8ec7f3

7 tests · 12518 LOC · 51 files · introduces 0 tests · 69 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
19 ranges69 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
1896 ranges12518 lines · 51 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.

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

src/vs/workbench/services/configuration/common/configurationModels.ts 69 introduced LOC · 19 ranges

Open complete file

1 > /*--------------------------------------------------------------------------------------------- configurationModels.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 { equals } from '../../../../base/common/objects.js';
7 > import { toValuesTree, IConfigurationModel, IConfigurationOverrides, IConfigurationValue, IConfigurationChange } from '../../../../platform/configuration/common/configuration.js';
8 > import { Configuration as BaseConfiguration, ConfigurationModelParser, ConfigurationModel, ConfigurationParseOptions } from '../../../../platform/configuration/common/configurationModels.js';
9 > import { IStoredWorkspaceFolder } from '../../../../platform/workspaces/common/workspaces.js';
10 > import { Workspace } from '../../../../platform/workspace/common/workspace.js';
11 > import { ResourceMap } from '../../../../base/common/map.js';
12 > import { URI } from '../../../../base/common/uri.js';
13 > import { isBoolean } from '../../../../base/common/types.js';
14 > import { distinct } from '../../../../base/common/arrays.js';
15 > import { ILogService } from '../../../../platform/log/common/log.js';
16 > import { IStringDictionary } from '../../../../base/common/collections.js';
17 >
18 > export class WorkspaceConfigurationModelParser extends ConfigurationModelParser {
19 >
20 > private _folders: IStoredWorkspaceFolder[] = [];
21 > private _transient: boolean = false;
22 > private _settingsModelParser: ConfigurationModelParser;
23 > private _launchModel: ConfigurationModel;
24 > private _tasksModel: ConfigurationModel;
25 >
26 > constructor(name: string, logService: ILogService) {
27 super(name, logService);
28 this._settingsModelParser = new ConfigurationModelParser(name, logService);
30 this._tasksModel = ConfigurationModel.createEmptyModel(logService);
31 }
33 > get folders(): IStoredWorkspaceFolder[] {
34 return this._folders;
35 }
37 > get transient(): boolean {
38 return this._transient;
39 }
41 > get settingsModel(): ConfigurationModel {
42 return this._settingsModelParser.configurationModel;
43 }
45 > get launchModel(): ConfigurationModel {
46 return this._launchModel;
47 }
49 > get tasksModel(): ConfigurationModel {
50 return this._tasksModel;
51 }
53 > reparseWorkspaceSettings(configurationParseOptions: ConfigurationParseOptions): void {
54 this._settingsModelParser.reparse(configurationParseOptions);
55 }
57 > getRestrictedWorkspaceSettings(): string[] {
58 return this._settingsModelParser.restrictedConfigurations;
59 }
61 > protected override doParseRaw(raw: IStringDictionary<unknown>, configurationParseOptions?: ConfigurationParseOptions): IConfigurationModel {
62 this._folders = (raw['folders'] || []) as IStoredWorkspaceFolder[];
63 this._transient = isBoolean(raw['transient']) && raw['transient'];
67 return super.doParseRaw(raw, configurationParseOptions);
68 }
70 > private createConfigurationModelFrom(raw: IStringDictionary<unknown>, key: string): ConfigurationModel {
71 const data = raw[key] as IStringDictionary<unknown> | undefined;
72 if (data) {
79 return ConfigurationModel.createEmptyModel(this.logService);
80 }
82 >
83 > export class StandaloneConfigurationModelParser extends ConfigurationModelParser {
84 >
85 > constructor(name: string, private readonly scope: string, logService: ILogService,) {
86 super(name, logService);
87 }
89 > protected override doParseRaw(raw: IStringDictionary<unknown>, configurationParseOptions?: ConfigurationParseOptions): IConfigurationModel {
90 const contents = toValuesTree(raw, message => console.error(`Conflict in settings file ${this._name}: ${message}`));
91 const scopedContents = Object.create(null);
94 return { contents: scopedContents, keys, overrides: [] };
95 }
97 > }
98 >
99 > export class Configuration extends BaseConfiguration {
100 >
101 > constructor(
102 defaults: ConfigurationModel,
103 policy: ConfigurationModel,
114 super(defaults, policy, application, localUser, remoteUser, workspaceConfiguration, folders, memoryConfiguration, memoryConfigurationByResource, logService);
115 }
117 > override getValue(key: string | undefined, overrides: IConfigurationOverrides = {}): unknown {
118 return super.getValue(key, overrides, this._workspace);
119 }
121 > override inspect<C>(key: string, overrides: IConfigurationOverrides = {}): IConfigurationValue<C> {
122 return super.inspect(key, overrides, this._workspace);
123 }
125 > override keys(): {
126 default: string[];
127 policy: string[];
132 return super.keys(this._workspace);
133 }
135 > override compareAndDeleteFolderConfiguration(folder: URI): IConfigurationChange {
136 if (this._workspace && this._workspace.folders.length > 0 && this._workspace.folders[0].uri.toString() === folder.toString()) {
137 // Do not remove workspace configuration
140 return super.compareAndDeleteFolderConfiguration(folder);
141 }
143 > compare(other: Configuration): IConfigurationChange {
144 const compare = (fromKeys: string[], toKeys: string[], overrideIdentifier?: string): string[] => {
145 const keys: string[] = [];