configurations.ts ×11

Frontier kind: Code frontier

unlabeled · c_b1adf194caa6

4 tests · 16510 LOC · 71 files · introduces 0 tests · 31 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
11 ranges31 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
2744 ranges16510 lines · 71 files · Browse complete extent
All tests (intent)
4 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: 31 introduced LOC across 11 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/platform/configuration/common/configurations.ts 31 introduced LOC · 11 ranges

Open complete file

250 const acceptsStringType = Array.isArray(property.type) ? property.type.includes('string') : property.type === 'string';
251 if (isString(policyValue) && !acceptsStringType) {
252 > try { configurations.ts
253 > policyValue = this.parse(policyValue);
254 > } catch (e) {
255 this.logService.error(`Error parsing policy value ${policyName}:`, getErrorMessage(e));
256 continue;
257 }
259 if (wasEmpty ? policyValue !== undefined : !equals(this._configurationModel.getValue(key), policyValue)) {
260 changed.push([key, policyValue]);
288
289 private parse(content: string): ParsedType {
290 > let raw: ParsedType = {}; configurations.ts
291 > let currentProperty: string | null = null;
292 > let currentParent: ParsedType = [];
293 > const previousParents: Array<ParsedType> = [];
294 > const parseErrors: json.ParseError[] = [];
295 >
296 > function onValue(value: unknown) {
297 > if (Array.isArray(currentParent)) {
298 > currentParent.push(value);
299 > } else if (currentProperty !== null) {
300 if (currentParent[currentProperty] !== undefined) {
301 throw new Error(`Duplicate property found: ${currentProperty}`);
303 currentParent[currentProperty] = value;
304 }
306 >
307 > const visitor: json.JSONVisitor = {
308 > onObjectBegin: () => {
309 const object = {};
310 onValue(object);
313 currentProperty = null;
314 },
315 > onObjectProperty: (name: string) => { configurations.ts
316 currentProperty = name;
317 },
318 > onObjectEnd: () => { configurations.ts
319 currentParent = previousParents.pop()!;
320 },
321 > onArrayBegin: () => { configurations.ts
322 const array: unknown[] = [];
323 onValue(array);
326 currentProperty = null;
327 },
328 > onArrayEnd: () => { configurations.ts
329 currentParent = previousParents.pop()!;
330 },
331 > onLiteralValue: onValue, configurations.ts
332 > onError: (error: json.ParseErrorCode, offset: number, length: number) => {
333 parseErrors.push({ error, offset, length });
334 }
336 >
337 > if (content) {
338 > json.visit(content, visitor);
339 > raw = (currentParent[0] as ParsedType | undefined) || raw;
340 > }
341
342 if (parseErrors.length > 0) {