updateUtils.ts ×13

Frontier kind: Code frontier

unlabeled · c_870f6123741b

36 tests · 3701 LOC · 21 files · introduces 0 tests · 208 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
14 ranges208 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
501 ranges3701 lines · 21 files · Browse complete extent
All tests (intent)
36 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 specializationupdateUtils.test|title=UpdateUtils formatBytes rounds to one decimal place correctly|occurrence=1 · 0 introduced LOCupdateUtils.test|title=U…updateUtils.ts ×1 · 2 introduced LOCupdateUtils.ts ×1updateUtils.ts ×1 · 4 introduced LOCupdateUtils.ts ×1updateUtils.ts ×1 · 2 introduced LOCupdateUtils.ts ×1updateUtils.ts ×1 · 3 introduced LOCupdateUtils.ts ×1updateUtils.ts ×1 · 3 introduced LOCupdateUtils.ts ×1updateUtils.ts ×1 · 2 introduced LOCupdateUtils.ts ×1updateUtils.ts ×1 · 3 introduced LOCupdateUtils.ts ×1updateUtils.ts ×1 · 7 introduced LOCupdateUtils.ts ×1updateUtils.ts ×1 · 2 introduced LOCupdateUtils.ts ×1updateUtils.ts ×1 · 3 introduced LOCupdateUtils.ts ×1updateUtils.ts ×1 · 3 introduced LOCupdateUtils.ts ×1updateUtils.ts ×1 · 2 introduced LOCupdateUtils.ts ×1updateUtils.ts ×1 · 1 introduced LOCupdateUtils.ts ×1updateUtils.ts ×1 · 2 introduced LOCupdateUtils.ts ×1updateUtils.ts ×1 · 2 introduced LOCupdateUtils.ts ×1updateUtils.ts ×1 · 3 introduced LOCupdateUtils.ts ×1updateUtils.ts ×1 · 1 introduced LOCupdateUtils.ts ×1updateUtils.test|title=UpdateUtils isMajorMinorVersionChange returns false for unparseable versions|occurrence=1 · 0 introduced LOCupdateUtils.test|title=U…updateUtils.test|title=UpdateUtils isMajorMinorVersionChange returns false when new version is undefined|occurrence=1, updateUtils.test|title=UpdateUtils isMajorMinorVersionChange returns false when previous version is undefined|occurrence=1 · 0 introduced LOCupdateUtils.test|title=U…updateUtils.ts ×2 · 4 introduced LOCupdateUtils.ts ×2updateUtils.test|title=UpdateUtils isMajorMinorVersionChange returns false for patch-only change|occurrence=1, updateUtils.test|title=UpdateUtils isMajorMinorVersionChange returns false for identical versions|occurrence=1, +2 · 0 introduced LOCupdateUtils.test|title=U…updateUtils.ts ×1 · 2 introduced LOCupdateUtils.ts ×1updateUtils.ts ×2 · 7 introduced LOCupdateUtils.ts ×2updateUtils.ts ×1 · 2 introduced LOCupdateUtils.ts ×1updateUtils.ts ×1 · 2 introduced LOCupdateUtils.ts ×1updateUtils.ts ×1 · 2 introduced LOCupdateUtils.ts ×1updateUtils.ts ×1 · 3 introduced LOCupdateUtils.ts ×1updateUtils.ts ×1 · 3 introduced LOCupdateUtils.ts ×1updateUtils.ts ×1 · 2 introduced LOCupdateUtils.ts ×1updateUtils.ts ×2 · 4 introduced LOCupdateUtils.ts ×2updateUtils.ts ×2 · 11 introduced LOCupdateUtils.ts ×2updateUtils.ts ×1 · 4 introduced LOCupdateUtils.ts ×1updateUtils.ts ×1 · 2 introduced LOCupdateUtils.ts ×1updateUtils.ts ×1 · 2 introduced LOCupdateUtils.ts ×1updateUtils.ts ×1 · 3 introduced LOCupdateUtils.ts ×1updateUtils.ts ×3 · 4 introduced LOCupdateUtils.ts ×3updateUtils.ts ×1 · 2 introduced LOCupdateUtils.ts ×1updateUtils.ts ×1 · 3 introduced LOCupdateUtils.ts ×1updateUtils.ts ×2 · 5 introduced LOCupdateUtils.ts ×2updateUtils.ts ×2 · 3 introduced LOCupdateUtils.ts ×2updateUtils.ts ×2 · 2 introduced LOCupdateUtils.ts ×2updateUtils.ts ×1 · 1 introduced LOCupdateUtils.ts ×1updateUtils.ts ×1 · 6 introduced LOCupdateUtils.ts ×1updateUtils.ts ×1 · 3 introduced LOCupdateUtils.ts ×1types.ts ×1 · 2 introduced LOCtypes.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 ×3instantiation.ts ×5 · 111 introduced LOCinstantiation.ts ×5lifecycle.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/platform/instantiation/common/instantiation.ts · 130 LOCcommon/instantiation.tssrc/vs/platform/update/common/update.ts · 127 LOCcommon/update.tssrc/vs/workbench/contrib/update/common/updateUtils.ts · 227 LOCcommon/updateUtils.tscharCode.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…updateUtils.test|title=UpdateUtils computeDownloadSpeed computes correct download speed in bytes per second|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/update/test/common/updateUtils.test|title=UpdateUtils computeDownloadSpeed computes correct download speed in bytes per second|occurrence=1updateUtils.test|title=U…updateUtils.test|title=UpdateUtils computeDownloadSpeed returns undefined for invalid or incomplete input|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/update/test/common/updateUtils.test|title=UpdateUtils computeDownloadSpeed returns undefined for invalid or incomplete input|occurrence=1updateUtils.test|title=U…updateUtils.test|title=UpdateUtils computeDownloadSpeed returns undefined for zero downloaded bytes|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/update/test/common/updateUtils.test|title=UpdateUtils computeDownloadSpeed returns undefined for zero downloaded bytes|occurrence=1updateUtils.test|title=U…updateUtils.test|title=UpdateUtils computeDownloadSpeed returns undefined for zero or negative elapsed time|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/update/test/common/updateUtils.test|title=UpdateUtils computeDownloadSpeed returns undefined for zero or negative elapsed time|occurrence=1updateUtils.test|title=U…updateUtils.test|title=UpdateUtils computeDownloadTimeRemaining computes correct time remaining|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/update/test/common/updateUtils.test|title=UpdateUtils computeDownloadTimeRemaining computes correct time remaining|occurrence=1updateUtils.test|title=U…updateUtils.test|title=UpdateUtils computeDownloadTimeRemaining returns 0 when download is complete or over-downloaded|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/update/test/common/updateUtils.test|title=UpdateUtils computeDownloadTimeRemaining returns 0 when download is complete or over-downloaded|occurrence=1updateUtils.test|title=U…updateUtils.test|title=UpdateUtils computeDownloadTimeRemaining returns undefined for invalid or incomplete input|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/update/test/common/updateUtils.test|title=UpdateUtils computeDownloadTimeRemaining returns undefined for invalid or incomplete input|occurrence=1updateUtils.test|title=U…updateUtils.test|title=UpdateUtils computeProgressPercent clamps to 0-100 range|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/update/test/common/updateUtils.test|title=UpdateUtils computeProgressPercent clamps to 0-100 range|occurrence=1updateUtils.test|title=U…updateUtils.test|title=UpdateUtils computeProgressPercent computes correct percentage|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/update/test/common/updateUtils.test|title=UpdateUtils computeProgressPercent computes correct percentage|occurrence=1updateUtils.test|title=U…updateUtils.test|title=UpdateUtils computeProgressPercent handles invalid values|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/update/test/common/updateUtils.test|title=UpdateUtils computeProgressPercent handles invalid values|occurrence=1updateUtils.test|title=U…updateUtils.test|title=UpdateUtils computeUpdateInfoVersion returns minor .0 version when major differs|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/update/test/common/updateUtils.test|title=UpdateUtils computeUpdateInfoVersion returns minor .0 version when major differs|occurrence=1updateUtils.test|title=U…updateUtils.test|title=UpdateUtils computeUpdateInfoVersion returns minor .0 version when minor differs|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/update/test/common/updateUtils.test|title=UpdateUtils computeUpdateInfoVersion returns minor .0 version when minor differs|occurrence=1updateUtils.test|title=U…updateUtils.test|title=UpdateUtils computeUpdateInfoVersion returns target version as-is when same minor|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/update/test/common/updateUtils.test|title=UpdateUtils computeUpdateInfoVersion returns target version as-is when same minor|occurrence=1updateUtils.test|title=U…updateUtils.test|title=UpdateUtils computeUpdateInfoVersion returns undefined for invalid versions|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/update/test/common/updateUtils.test|title=UpdateUtils computeUpdateInfoVersion returns undefined for invalid versions|occurrence=1updateUtils.test|title=U…updateUtils.test|title=UpdateUtils formatBytes formats bytes for values less than 1 KB|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/update/test/common/updateUtils.test|title=UpdateUtils formatBytes formats bytes for values less than 1 KB|occurrence=1updateUtils.test|title=U…updateUtils.test|title=UpdateUtils formatBytes formats gigabytes for values >= 1 GB|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/update/test/common/updateUtils.test|title=UpdateUtils formatBytes formats gigabytes for values >= 1 GB|occurrence=1updateUtils.test|title=U…updateUtils.test|title=UpdateUtils formatBytes formats kilobytes for values between 1 KB and 1 MB|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/update/test/common/updateUtils.test|title=UpdateUtils formatBytes formats kilobytes for values between 1 KB and 1 MB|occurrence=1updateUtils.test|title=U…updateUtils.test|title=UpdateUtils formatBytes formats megabytes for values between 1 MB and 1 GB|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/update/test/common/updateUtils.test|title=UpdateUtils formatBytes formats megabytes for values between 1 MB and 1 GB|occurrence=1updateUtils.test|title=U…updateUtils.test|title=UpdateUtils formatBytes rounds to one decimal place correctly|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/update/test/common/updateUtils.test|title=UpdateUtils formatBytes rounds to one decimal place correctly|occurrence=1updateUtils.test|title=U…updateUtils.test|title=UpdateUtils formatDate formats a timestamp as a readable date|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/update/test/common/updateUtils.test|title=UpdateUtils formatDate formats a timestamp as a readable date|occurrence=1updateUtils.test|title=U…updateUtils.test|title=UpdateUtils formatTimeRemaining formats fractional hours for values >= 1 hour|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/update/test/common/updateUtils.test|title=UpdateUtils formatTimeRemaining formats fractional hours for values >= 1 hour|occurrence=1updateUtils.test|title=U…updateUtils.test|title=UpdateUtils formatTimeRemaining formats minutes for values between 1 minute and 1 hour|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/update/test/common/updateUtils.test|title=UpdateUtils formatTimeRemaining formats minutes for values between 1 minute and 1 hour|occurrence=1updateUtils.test|title=U…updateUtils.test|title=UpdateUtils formatTimeRemaining formats seconds for values less than 1 minute|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/update/test/common/updateUtils.test|title=UpdateUtils formatTimeRemaining formats seconds for values less than 1 minute|occurrence=1updateUtils.test|title=U…updateUtils.test|title=UpdateUtils getUpdateInfoUrl constructs correct URL for .0 versions|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/update/test/common/updateUtils.test|title=UpdateUtils getUpdateInfoUrl constructs correct URL for .0 versions|occurrence=1updateUtils.test|title=U…updateUtils.test|title=UpdateUtils getUpdateInfoUrl constructs correct URL for patch versions|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/update/test/common/updateUtils.test|title=UpdateUtils getUpdateInfoUrl constructs correct URL for patch versions|occurrence=1updateUtils.test|title=U…updateUtils.test|title=UpdateUtils isMajorMinorVersionChange returns false for identical versions|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/update/test/common/updateUtils.test|title=UpdateUtils isMajorMinorVersionChange returns false for identical versions|occurrence=1updateUtils.test|title=U…updateUtils.test|title=UpdateUtils isMajorMinorVersionChange returns false for patch-only change|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/update/test/common/updateUtils.test|title=UpdateUtils isMajorMinorVersionChange returns false for patch-only change|occurrence=1updateUtils.test|title=U…updateUtils.test|title=UpdateUtils isMajorMinorVersionChange returns false for unparseable versions|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/update/test/common/updateUtils.test|title=UpdateUtils isMajorMinorVersionChange returns false for unparseable versions|occurrence=1updateUtils.test|title=U…updateUtils.test|title=UpdateUtils isMajorMinorVersionChange returns false when both versions are undefined|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/update/test/common/updateUtils.test|title=UpdateUtils isMajorMinorVersionChange returns false when both versions are undefined|occurrence=1updateUtils.test|title=U…updateUtils.test|title=UpdateUtils isMajorMinorVersionChange returns false when new version is undefined|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/update/test/common/updateUtils.test|title=UpdateUtils isMajorMinorVersionChange returns false when new version is undefined|occurrence=1updateUtils.test|title=U…updateUtils.test|title=UpdateUtils isMajorMinorVersionChange returns false when previous version is undefined|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/update/test/common/updateUtils.test|title=UpdateUtils isMajorMinorVersionChange returns false when previous version is undefined|occurrence=1updateUtils.test|title=U…updateUtils.test|title=UpdateUtils isMajorMinorVersionChange returns true for major version change|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/update/test/common/updateUtils.test|title=UpdateUtils isMajorMinorVersionChange returns true for major version change|occurrence=1updateUtils.test|title=U…updateUtils.test|title=UpdateUtils isMajorMinorVersionChange returns true for minor version change|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/update/test/common/updateUtils.test|title=UpdateUtils isMajorMinorVersionChange returns true for minor version change|occurrence=1updateUtils.test|title=U…updateUtils.test|title=UpdateUtils tryParseDate parses valid ISO date strings|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/update/test/common/updateUtils.test|title=UpdateUtils tryParseDate parses valid ISO date strings|occurrence=1updateUtils.test|title=U…updateUtils.test|title=UpdateUtils tryParseDate returns undefined for invalid date strings|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/update/test/common/updateUtils.test|title=UpdateUtils tryParseDate returns undefined for invalid date strings|occurrence=1updateUtils.test|title=U…updateUtils.test|title=UpdateUtils tryParseDate returns undefined for undefined input|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/update/test/common/updateUtils.test|title=UpdateUtils tryParseDate returns undefined for undefined input|occurrence=1updateUtils.test|title=U…Focused concept · updateUtils.ts ×13 · 208 introduced LOCupdateUtils.ts ×13

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

src/vs/platform/update/common/update.ts 127 introduced LOC · 1 range

Open complete file

1 > /*--------------------------------------------------------------------------------------------- update.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 { Event } from '../../../base/common/event.js';
7 > import { upcast } from '../../../base/common/types.js';
8 > import { createDecorator } from '../../instantiation/common/instantiation.js';
9 >
10 > export interface IUpdate {
11 > version: string; // Build commit ID
12 > productVersion?: string; // Product version like 1.2.3
13 > timestamp?: number;
14 > url?: string;
15 > sha256hash?: string;
16 > }
17 >
18 > /**
19 > * Updates are run as a state machine:
20 > *
21 > * Uninitialized
22 > * ↓
23 > * Idle
24 > * ↓ ↑
25 > * Checking for Updates → Available for Download
26 > * ↓ ↓
27 > * ← Overwriting
28 > * Downloading ↑
29 > * → Ready
30 > * ↓ ↑
31 > * Downloaded → Updating
32 > *
33 > * Available: There is an update available for download (linux, darwin on metered connection).
34 > * Ready: Code will be updated as soon as it restarts (win32, darwin).
35 > * Downloaded: There is an update ready to be installed in the background (win32).
36 > * Overwriting: A newer update is being downloaded to replace the pending update (darwin).
37 > * Cancelling: Updates are being disabled at runtime; in-flight/pending work is being torn down before Disabled.
38 > */
39 >
40 > export const enum StateType {
41 > Uninitialized = 'uninitialized',
42 > Idle = 'idle',
43 > Disabled = 'disabled',
44 > CheckingForUpdates = 'checking for updates',
45 > AvailableForDownload = 'available for download',
46 > Downloading = 'downloading',
47 > Downloaded = 'downloaded',
48 > Updating = 'updating',
49 > Ready = 'ready',
50 > Overwriting = 'overwriting',
51 > Cancelling = 'cancelling',
52 > Restarting = 'restarting',
53 > }
54 >
55 > export const enum UpdateType {
56 > Setup,
57 > Archive,
58 > Snap
59 > }
60 >
61 > export const enum DisablementReason {
62 > NotBuilt,
63 > DisabledByEnvironment,
64 > ManuallyDisabled,
65 > Policy,
66 > MissingConfiguration,
67 > InvalidConfiguration,
68 > RunningAsAdmin,
69 > }
70 >
71 > export type Uninitialized = { type: StateType.Uninitialized };
72 > export type Disabled = { type: StateType.Disabled; reason: DisablementReason };
73 > export type Idle = { type: StateType.Idle; updateType: UpdateType; error?: string; notAvailable?: boolean };
74 > export type CheckingForUpdates = { type: StateType.CheckingForUpdates; explicit: boolean };
75 > export type AvailableForDownload = { type: StateType.AvailableForDownload; update: IUpdate; canInstall?: boolean };
76 > export type Downloading = { type: StateType.Downloading; update?: IUpdate; explicit: boolean; overwrite: boolean; downloadedBytes?: number; totalBytes?: number; startTime?: number };
77 > export type Downloaded = { type: StateType.Downloaded; update: IUpdate; explicit: boolean; overwrite: boolean };
78 > export type Updating = { type: StateType.Updating; update: IUpdate; currentProgress?: number; maxProgress?: number; explicit: boolean };
79 > export type Ready = { type: StateType.Ready; update: IUpdate; explicit: boolean; overwrite: boolean };
80 > export type Overwriting = { type: StateType.Overwriting; update: IUpdate; explicit: boolean };
81 > export type Cancelling = { type: StateType.Cancelling };
82 > export type Restarting = { type: StateType.Restarting; update: IUpdate };
83 >
84 > export type State = Uninitialized | Disabled | Idle | CheckingForUpdates | AvailableForDownload | Downloading | Downloaded | Updating | Ready | Overwriting | Cancelling | Restarting;
85 >
86 > export const State = {
87 > Uninitialized: upcast<Uninitialized>({ type: StateType.Uninitialized }),
88 > Disabled: (reason: DisablementReason): Disabled => ({ type: StateType.Disabled, reason }),
89 > Idle: (updateType: UpdateType, error?: string, notAvailable?: boolean): Idle => ({ type: StateType.Idle, updateType, error, notAvailable }),
90 > CheckingForUpdates: (explicit: boolean): CheckingForUpdates => ({ type: StateType.CheckingForUpdates, explicit }),
91 > AvailableForDownload: (update: IUpdate, canInstall?: boolean): AvailableForDownload => ({ type: StateType.AvailableForDownload, update, canInstall }),
92 > Downloading: (update: IUpdate | undefined, explicit: boolean, overwrite: boolean, downloadedBytes?: number, totalBytes?: number, startTime?: number): Downloading => ({ type: StateType.Downloading, update, explicit, overwrite, downloadedBytes, totalBytes, startTime }),
93 > Downloaded: (update: IUpdate, explicit: boolean, overwrite: boolean): Downloaded => ({ type: StateType.Downloaded, update, explicit, overwrite }),
94 > Updating: (update: IUpdate, explicit: boolean, currentProgress?: number, maxProgress?: number): Updating => ({ type: StateType.Updating, update, explicit, currentProgress, maxProgress }),
95 > Ready: (update: IUpdate, explicit: boolean, overwrite: boolean): Ready => ({ type: StateType.Ready, update, explicit, overwrite }),
96 > Overwriting: (update: IUpdate, explicit: boolean): Overwriting => ({ type: StateType.Overwriting, update, explicit }),
97 > Cancelling: upcast<Cancelling>({ type: StateType.Cancelling }),
98 > Restarting: (update: IUpdate): Restarting => ({ type: StateType.Restarting, update }),
99 > };
100 >
101 > export interface IAutoUpdater extends Event.NodeEventEmitter {
102 > setFeedURL(url: string): void;
103 > checkForUpdates(): void;
104 > applyUpdate?(): Promise<void>;
105 > quitAndInstall(): void;
106 > }
107 >
108 > export const IUpdateService = createDecorator<IUpdateService>('updateService');
109 >
110 > export interface IUpdateService {
111 > readonly _serviceBrand: undefined;
112 >
113 > readonly onStateChange: Event<State>;
114 > readonly state: State;
115 >
116 > checkForUpdates(explicit: boolean): Promise<void>;
117 > downloadUpdate(explicit: boolean): Promise<void>;
118 > applyUpdate(): Promise<void>;
119 > quitAndInstall(): Promise<void>;
120 >
121 > /**
122 > * @deprecated This method should not be used any more. It will be removed in a future release.
123 > */
124 > isLatestVersion(): Promise<boolean | undefined>;
125 > _applySpecificUpdate(packagePath: string): Promise<void>;
126 > setInternalOrg(internalOrg: string | undefined): Promise<void>;
127 > }
src/vs/workbench/contrib/update/common/updateUtils.ts 81 introduced LOC · 13 ranges

Open complete file

1 > /*--------------------------------------------------------------------------------------------- updateUtils.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 { localize } from '../../../../nls.js';
7 > import { Downloading } from '../../../../platform/update/common/update.js';
8 >
9 > /**
10 > * Returns the progress percentage based on the current and maximum progress values.
11 > */
12 > export function computeProgressPercent(current: number | undefined, max: number | undefined): number | undefined {
13 if (current === undefined || max === undefined || max <= 0) {
14 return undefined;
17 return Math.max(Math.min(Math.round((current / max) * 100), 100), 0);
18 }
20 > /**
21 > * Computes an estimate of remaining download time in seconds.
22 > */
23 > export function computeDownloadTimeRemaining(state: Downloading): number | undefined {
24 const { downloadedBytes, totalBytes, startTime } = state;
25 if (downloadedBytes === undefined || totalBytes === undefined || startTime === undefined) {
45 return Math.ceil(remainingMs / 1000);
46 }
48 > /**
49 > * Computes the current download speed in bytes per second.
50 > */
51 > export function computeDownloadSpeed(state: Downloading): number | undefined {
52 const { downloadedBytes, startTime } = state;
53 if (downloadedBytes === undefined || startTime === undefined) {
62 return (downloadedBytes / elapsedMs) * 1000;
63 }
65 > /**
66 > * Computes the version to use for fetching update info.
67 > * - If the minor version differs: returns `{major}.{minor}` (e.g., 1.108.2 -> 1.109.5 => 1.109)
68 > * - If the same minor: returns the target version as-is (e.g., 1.109.2 -> 1.109.5 => 1.109.5)
69 > */
70 > export function computeUpdateInfoVersion(currentVersion: string, targetVersion: string): string | undefined {
71 const current = tryParseVersion(currentVersion);
72 const target = tryParseVersion(targetVersion);
81 return `${target.major}.${target.minor}.${target.patch}`;
82 }
84 > /**
85 > * Computes the URL to fetch update info from.
86 > * Follows the release notes URL pattern but with `_update` suffix.
87 > */
88 > export function getUpdateInfoUrl(version: string): string {
89 const versionLabel = version.replace(/\./g, '_').replace(/_0$/, '');
90 return `https://code.visualstudio.com/raw/v${versionLabel}_update.md`;
91 }
93 > /**
94 > * Formats the time remaining as a human-readable string.
95 > */
96 > export function formatTimeRemaining(seconds: number): string {
97 const hours = seconds / 3600;
98 if (hours >= 1) {
112 return localize('update.timeRemainingSeconds', "{0}s", seconds);
113 }
115 > /**
116 > * Formats a byte count as a human-readable string.
117 > */
118 > export function formatBytes(bytes: number): string {
119 if (bytes < 1024) {
120 return localize('update.bytes', "{0} B", bytes);
134 return localize('update.gigabytes', "{0} GB", formatDecimal(gb));
135 }
137 > /**
138 > * Tries to parse a date string and returns the timestamp or undefined if parsing fails.
139 > */
140 > export function tryParseDate(date: string | undefined): number | undefined {
141 if (date === undefined) {
142 return undefined;
150 }
151 }
153 > /**
154 > * Formats a timestamp as a localized date string.
155 > */
156 > export function formatDate(timestamp: number): string {
157 return new Date(timestamp).toLocaleDateString(undefined, {
158 year: 'numeric',
161 });
162 }
164 > /**
165 > * Formats a number to 1 decimal place, omitting ".0" for whole numbers.
166 > */
167 > export function formatDecimal(value: number): string {
168 const rounded = Math.round(value * 10) / 10;
169 return rounded % 1 === 0 ? rounded.toString() : rounded.toFixed(1);
170 }
172 > export interface IVersion {
173 > major: number;
174 > minor: number;
175 > patch: number;
176 > }
177 >
178 > /**
179 > * Parses a version string in the format "major.minor.patch" and returns an object with the components.
180 > */
181 > export function tryParseVersion(version: string | undefined): IVersion | undefined {
182 if (version === undefined) {
183 return undefined;
199 }
200 }
202 > /**
203 > * Processes an error message and returns a user-friendly version of it, or undefined if the error should be ignored.
204 > */
205 > export function preprocessError(error?: string): string | undefined {
206 if (!error) {
207 return undefined;
217 );
218 }
220 > /**
221 > * Determines whether there is a major or minor version change between two versions.
222 > */
223 > export function isMajorMinorVersionChange(previousVersion?: string, newVersion?: string): boolean {
224 const previous = tryParseVersion(previousVersion);
225 const current = tryParseVersion(newVersion);