updateInfoParser.ts ×6

Frontier kind: Code frontier

unlabeled · c_a6da1556e496

20 tests · 3489 LOC · 19 files · introduces 0 tests · 109 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
6 ranges109 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
487 ranges3489 lines · 19 files · Browse complete extent
All tests (intent)
20 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.

Introduced files, introduced tests, and structurally relevant concept specializationupdateInfoParser.ts ×1 · 2 introduced LOCupdateInfoParser.ts ×1updateInfoParser.test|title=updateInfoParser parseUpdateInfoInput block frontmatter with buttons|occurrence=1, updateInfoParser.test|title=updateInfoParser parseUpdateInfoInput block frontmatter with no body|occurrence=1 · 0 introduced LOCupdateInfoParser.test|ti…updateInfoParser.ts ×1 · 2 introduced LOCupdateInfoParser.ts ×1updateInfoParser.test|title=updateInfoParser parseUpdateInfoInput ignores invalid style values|occurrence=1, updateInfoParser.test|title=updateInfoParser parseUpdateInfoInput JSON envelope with markdown and buttons|occurrence=1 · 0 introduced LOCupdateInfoParser.test|ti…updateInfoParser.test|title=updateInfoParser parseUpdateInfoInput block frontmatter with bannerImageUrl, badge, title, and features|occurrence=1 · 0 introduced LOCupdateInfoParser.test|ti…updateInfoParser.ts ×1 · 2 introduced LOCupdateInfoParser.ts ×1updateInfoParser.ts ×1 · 1 introduced LOCupdateInfoParser.ts ×1updateInfoParser.ts ×1 · 2 introduced LOCupdateInfoParser.ts ×1updateInfoParser.ts ×2 · 4 introduced LOCupdateInfoParser.ts ×2updateInfoParser.ts ×3 · 16 introduced LOCupdateInfoParser.ts ×3updateInfoParser.test|title=updateInfoParser parseUpdateInfoInput ignores non-string feature icon|occurrence=1, updateInfoParser.test|title=updateInfoParser parseUpdateInfoInput JSON envelope with bannerImageUrl, badge, title, and features|occurrence=1 · 0 introduced LOCupdateInfoParser.test|ti…updateInfoParser.ts ×4 · 11 introduced LOCupdateInfoParser.ts ×4updateInfoParser.test|title=updateInfoParser parseUpdateInfoInput JSON envelope without buttons|occurrence=1, updateInfoParser.test|title=updateInfoParser parseUpdateInfoInput ignores non-string bannerImageUrl, badge, and title|occurrence=1 · 0 introduced LOCupdateInfoParser.test|ti…updateInfoParser.ts ×1 · 2 introduced LOCupdateInfoParser.ts ×1updateInfoParser.ts ×1 · 3 introduced LOCupdateInfoParser.ts ×1updateInfoParser.ts ×1 · 2 introduced LOCupdateInfoParser.ts ×1updateInfoParser.ts ×1 · 2 introduced LOCupdateInfoParser.ts ×1updateInfoParser.ts ×1 · 2 introduced LOCupdateInfoParser.ts ×1updateInfoParser.ts ×1 · 2 introduced LOCupdateInfoParser.ts ×1updateInfoParser.test|title=updateInfoParser parseUpdateInfoInput strips BOM prefix|occurrence=1, updateInfoParser.test|title=updateInfoParser parseUpdateInfoInput plain markdown returns as-is with no buttons|occurrence=1, +1 · 0 introduced LOCupdateInfoParser.test|ti…updateInfoParser.ts ×2 · 6 introduced LOCupdateInfoParser.ts ×2updateInfoParser.ts ×5 · 20 introduced LOCupdateInfoParser.ts ×5updateInfoParser.ts ×1 · 3 introduced LOCupdateInfoParser.ts ×1updateInfoParser.ts ×1 · 2 introduced LOCupdateInfoParser.ts ×1updateInfoParser.ts ×1 · 2 introduced LOCupdateInfoParser.ts ×1updateInfoParser.ts ×2 · 4 introduced LOCupdateInfoParser.ts ×2updateInfoParser.ts ×1 · 4 introduced LOCupdateInfoParser.ts ×1uri.test|title=URI URI#file, win-speciale|occurrence=1, charCode.test|title=CharCode has good values|occurrence=1, +2 · 0 introduced LOCuri.test|title=URI URI#f…utils.ts ×3 · 9 introduced LOCutils.ts ×3lifecycle.ts ×2 · 4 introduced LOClifecycle.ts ×2lifecycle.ts ×1 · 2 introduced LOClifecycle.ts ×1lifecycle.ts ×4 · 8 introduced LOClifecycle.ts ×4lifecycle.ts ×6 · 16 introduced LOClifecycle.ts ×6lifecycle.ts ×1 · 2 introduced LOClifecycle.ts ×1lifecycle.ts ×1 · 2 introduced LOClifecycle.ts ×1lifecycle.ts ×1 · 3 introduced LOClifecycle.ts ×1map.ts ×97 · 3334 introduced LOCmap.ts ×97src/vs/base/common/arrays.ts · 949 LOCcommon/arrays.tssrc/vs/base/common/arraysFind.ts · 226 LOCcommon/arraysFind.tssrc/vs/base/common/assert.ts · 91 LOCcommon/assert.tssrc/vs/base/common/charCode.ts · 450 LOCcommon/charCode.tssrc/vs/base/common/collections.ts · 176 LOCcommon/collections.tssrc/vs/base/common/errors.ts · 357 LOCcommon/errors.tssrc/vs/base/common/functional.ts · 32 LOCcommon/functional.tssrc/vs/base/common/iterator.ts · 194 LOCcommon/iterator.tssrc/vs/base/common/lifecycle.ts · 974 LOCcommon/lifecycle.tssrc/vs/base/common/map.ts · 1016 LOCcommon/map.tssrc/vs/base/common/marshallingIds.ts · 33 LOCcommon/marshallingIds.tssrc/vs/base/common/path.ts · 1589 LOCcommon/path.tssrc/vs/base/common/platform.ts · 281 LOCcommon/platform.tssrc/vs/base/common/process.ts · 76 LOCcommon/process.tssrc/vs/base/common/types.ts · 410 LOCcommon/types.tssrc/vs/base/common/uri.ts · 754 LOCcommon/uri.tssrc/vs/base/test/common/utils.ts · 107 LOCcommon/utils.tssrc/vs/nls.ts · 244 LOCvs/nls.tssrc/vs/workbench/contrib/update/common/updateInfoParser.ts · 205 LOCcommon/updateInfoParser.…charCode.test|title=CharCode has good values|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/charCode.test|title=CharCode has good values|occurrence=1charCode.test|title=Char…path.test|title=Paths (Node Implementation) path|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/path.test|title=Paths (Node Implementation) path|occurrence=1path.test|title=Paths (N…uri.test|title=URI File paths containing apostrophes break URI parsing and cannot be opened #276075|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/uri.test|title=URI File paths containing apostrophes break URI parsing and cannot be opened #276075|occurrence=1uri.test|title=URI File …uri.test|title=URI URI#file, win-speciale|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/uri.test|title=URI URI#file, win-speciale|occurrence=1uri.test|title=URI URI#f…updateInfoParser.test|title=updateInfoParser parseUpdateInfoInput JSON envelope with bannerImageUrl, badge, title, and features|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/update/test/common/updateInfoParser.test|title=updateInfoParser parseUpdateInfoInput JSON envelope with bannerImageUrl, badge, title, and features|occurrence=1updateInfoParser.test|ti…updateInfoParser.test|title=updateInfoParser parseUpdateInfoInput JSON envelope with invalid JSON falls back to plain markdown|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/update/test/common/updateInfoParser.test|title=updateInfoParser parseUpdateInfoInput JSON envelope with invalid JSON falls back to plain markdown|occurrence=1updateInfoParser.test|ti…updateInfoParser.test|title=updateInfoParser parseUpdateInfoInput JSON envelope with markdown and buttons|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/update/test/common/updateInfoParser.test|title=updateInfoParser parseUpdateInfoInput JSON envelope with markdown and buttons|occurrence=1updateInfoParser.test|ti…updateInfoParser.test|title=updateInfoParser parseUpdateInfoInput JSON envelope without buttons|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/update/test/common/updateInfoParser.test|title=updateInfoParser parseUpdateInfoInput JSON envelope without buttons|occurrence=1updateInfoParser.test|ti…updateInfoParser.test|title=updateInfoParser parseUpdateInfoInput JSON envelope without markdown property falls back to plain markdown|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/update/test/common/updateInfoParser.test|title=updateInfoParser parseUpdateInfoInput JSON envelope without markdown property falls back to plain markdown|occurrence=1updateInfoParser.test|ti…updateInfoParser.test|title=updateInfoParser parseUpdateInfoInput block frontmatter with bannerImageUrl, badge, title, and features|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/update/test/common/updateInfoParser.test|title=updateInfoParser parseUpdateInfoInput block frontmatter with bannerImageUrl, badge, title, and features|occurrence=1updateInfoParser.test|ti…updateInfoParser.test|title=updateInfoParser parseUpdateInfoInput block frontmatter with buttons|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/update/test/common/updateInfoParser.test|title=updateInfoParser parseUpdateInfoInput block frontmatter with buttons|occurrence=1updateInfoParser.test|ti…updateInfoParser.test|title=updateInfoParser parseUpdateInfoInput block frontmatter with no body|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/update/test/common/updateInfoParser.test|title=updateInfoParser parseUpdateInfoInput block frontmatter with no body|occurrence=1updateInfoParser.test|ti…updateInfoParser.test|title=updateInfoParser parseUpdateInfoInput caps features at 5 entries and skips invalid ones|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/update/test/common/updateInfoParser.test|title=updateInfoParser parseUpdateInfoInput caps features at 5 entries and skips invalid ones|occurrence=1updateInfoParser.test|ti…updateInfoParser.test|title=updateInfoParser parseUpdateInfoInput frontmatter with invalid JSON falls back to full text|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/update/test/common/updateInfoParser.test|title=updateInfoParser parseUpdateInfoInput frontmatter with invalid JSON falls back to full text|occurrence=1updateInfoParser.test|ti…updateInfoParser.test|title=updateInfoParser parseUpdateInfoInput ignores invalid style values|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/update/test/common/updateInfoParser.test|title=updateInfoParser parseUpdateInfoInput ignores invalid style values|occurrence=1updateInfoParser.test|ti…updateInfoParser.test|title=updateInfoParser parseUpdateInfoInput ignores non-string bannerImageUrl, badge, and title|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/update/test/common/updateInfoParser.test|title=updateInfoParser parseUpdateInfoInput ignores non-string bannerImageUrl, badge, and title|occurrence=1updateInfoParser.test|ti…updateInfoParser.test|title=updateInfoParser parseUpdateInfoInput ignores non-string feature icon|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/update/test/common/updateInfoParser.test|title=updateInfoParser parseUpdateInfoInput ignores non-string feature icon|occurrence=1updateInfoParser.test|ti…updateInfoParser.test|title=updateInfoParser parseUpdateInfoInput inline frontmatter handles nested JSON with braces|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/update/test/common/updateInfoParser.test|title=updateInfoParser parseUpdateInfoInput inline frontmatter handles nested JSON with braces|occurrence=1updateInfoParser.test|ti…updateInfoParser.test|title=updateInfoParser parseUpdateInfoInput inline frontmatter with buttons|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/update/test/common/updateInfoParser.test|title=updateInfoParser parseUpdateInfoInput inline frontmatter with buttons|occurrence=1updateInfoParser.test|ti…updateInfoParser.test|title=updateInfoParser parseUpdateInfoInput plain markdown returns as-is with no buttons|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/update/test/common/updateInfoParser.test|title=updateInfoParser parseUpdateInfoInput plain markdown returns as-is with no buttons|occurrence=1updateInfoParser.test|ti…updateInfoParser.test|title=updateInfoParser parseUpdateInfoInput returns undefined buttons when all buttons are invalid|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/update/test/common/updateInfoParser.test|title=updateInfoParser parseUpdateInfoInput returns undefined buttons when all buttons are invalid|occurrence=1updateInfoParser.test|ti…updateInfoParser.test|title=updateInfoParser parseUpdateInfoInput returns undefined features when all features are invalid|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/update/test/common/updateInfoParser.test|title=updateInfoParser parseUpdateInfoInput returns undefined features when all features are invalid|occurrence=1updateInfoParser.test|ti…updateInfoParser.test|title=updateInfoParser parseUpdateInfoInput skips buttons with missing required properties|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/update/test/common/updateInfoParser.test|title=updateInfoParser parseUpdateInfoInput skips buttons with missing required properties|occurrence=1updateInfoParser.test|ti…updateInfoParser.test|title=updateInfoParser parseUpdateInfoInput strips BOM prefix|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/update/test/common/updateInfoParser.test|title=updateInfoParser parseUpdateInfoInput strips BOM prefix|occurrence=1updateInfoParser.test|ti…Focused concept · updateInfoParser.ts ×6 · 109 introduced LOCupdateInfoParser.ts ×6

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: 109 introduced LOC across 6 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/workbench/contrib/update/common/updateInfoParser.ts 109 introduced LOC · 6 ranges

Open complete file

1 > /*--------------------------------------------------------------------------------------------- updateInfoParser.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 { hasKey, Mutable } from '../../../../base/common/types.js';
7 >
8 > const MAX_FEATURES = 5;
9 >
10 > export type UpdateInfoButtonStyle = 'primary' | 'secondary';
11 >
12 > export interface IUpdateInfoButton {
13 > readonly label: string;
14 > readonly commandId: string;
15 > readonly args?: unknown[];
16 > readonly style?: UpdateInfoButtonStyle;
17 > }
18 >
19 > export interface IUpdateInfoFeature {
20 > /**
21 > * Optional Codicon icon identifier (e.g. `$(sparkle)` or `$(lightbulb)`) displayed
22 > * alongside the feature title.
23 > */
24 > readonly icon?: string;
25 > /** Short title for the feature highlight. */
26 > readonly title: string;
27 > /** One-line description of the feature. */
28 > readonly description: string;
29 > }
30 >
31 > export interface IParsedUpdateInfoInput {
32 > /** Markdown body rendered in the update-info widget. */
33 > readonly markdown: string;
34 > /** Optional action buttons shown below the markdown content. */
35 > readonly buttons?: IUpdateInfoButton[];
36 > /**
37 > * Optional URL for a banner/hero image shown at the top of the widget.
38 > * Must be an `https://` URL; non-HTTPS URLs are ignored.
39 > */
40 > readonly bannerImageUrl?: string;
41 > /** Optional short badge label (e.g. `"New"`) displayed on the widget. */
42 > readonly badge?: string;
43 > /** Optional heading title rendered above the markdown body. */
44 > readonly title?: string;
45 > /**
46 > * Optional list of feature highlights. At most {@link MAX_FEATURES} entries
47 > * (currently 5) are displayed; any additional entries are silently dropped.
48 > */
49 > readonly features?: IUpdateInfoFeature[];
50 > }
51 >
52 > /**
53 > * Parses optional metadata from update info input.
54 > *
55 > * Supported formats:
56 > *
57 > * **JSON envelope** - a single JSON object with `markdown` and optional fields:
58 > * ```json
59 > * {
60 > * "markdown": "$(info) **Feature**<br>Description...",
61 > * "title": "What's New",
62 > * "badge": "New",
63 > * "bannerImageUrl": "https://example.com/banner.png",
64 > * "buttons": [
65 > * { "label": "Release Notes", "commandId": "update.showCurrentReleaseNotes", "style": "secondary" },
66 > * { "label": "Open Sessions", "commandId": "workbench.action.chat.open", "style": "primary" }
67 > * ],
68 > * "features": [
69 > * { "icon": "$(sparkle)", "title": "Feature", "description": "Short description" }
70 > * ]
71 > * }
72 > * ```
73 > *
74 > * **Block frontmatter** - YAML-style `---` delimiters wrapping a JSON metadata block:
75 > * ```
76 > * ---
77 > * { "buttons": [...], "features": [...] }
78 > * ---
79 > * $(info) **Feature**<br>Description...
80 > * ```
81 > *
82 > * **Inline frontmatter** - metadata on a single `---` line:
83 > * ```
84 > * --- { "buttons": [...] } ---
85 > * $(info) **Feature**<br>Description...
86 > * ```
87 > *
88 > * At most 5 feature entries are retained; any additional ones are silently dropped.
89 > */
90 > export function parseUpdateInfoInput(text: string): IParsedUpdateInfoInput {
91 > const normalized = text.replace(/^\uFEFF/, '');
92 > return tryParseUpdateInfoEnvelope(normalized) ?? parseUpdateInfoFrontmatter(normalized);
93 > }
94 >
95 > function tryParseUpdateInfoEnvelope(text: string): IParsedUpdateInfoInput | undefined {
96 > const trimmed = text.trim();
97 > if (!trimmed.startsWith('{') || !trimmed.endsWith('}')) {
98 return undefined;
99 }
109 return undefined;
110 }
112 >
113 function buildParsedInput(markdown: string, meta: { buttons?: unknown; bannerImageUrl?: unknown; badge?: unknown; title?: unknown; features?: unknown }): IParsedUpdateInfoInput {
114 const result: Mutable<IParsedUpdateInfoInput> = {
123 return result;
124 }
126 function parseUpdateInfoFrontmatter(text: string): IParsedUpdateInfoInput {
127 const blockMatch = text.match(/^---[ \t]*\r?\n(?<json>[\s\S]*?)\r?\n---[ \t]*(?:\r?\n(?<body>[\s\S]*))?$/);
137 return { markdown: text };
138 }
140 function parseUpdateInfoFrontmatterMatch(text: string, jsonText: string, markdown: string): IParsedUpdateInfoInput {
141 try {
146 }
147 }
149 function parseUpdateInfoButtons(buttons: unknown): IUpdateInfoButton[] | undefined {
150 if (!Array.isArray(buttons)) {
174 return parsedButtons.length ? parsedButtons : undefined;
175 }
177 > /**
178 > * Parses an array of feature-highlight objects from raw update-info metadata.
179 > * Only the first {@link MAX_FEATURES} valid entries are returned; the rest are
180 > * discarded. Each entry must have at minimum a `title` and `description` string.
181 > * The optional `icon` field accepts a Codicon identifier (e.g. `$(sparkle)`).
182 > */
183 function parseUpdateInfoFeatures(features: unknown): IUpdateInfoFeature[] | undefined {
184 if (!Array.isArray(features)) {