schedule.ts ×7

Frontier kind: Code frontier

unlabeled · c_6c0503e10b41

15 tests · 3442 LOC · 19 files · introduces 0 tests · 48 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
7 ranges48 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
495 ranges3442 lines · 19 files · Browse complete extent
All tests (intent)
15 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 specializationschedule.ts ×1 · 1 introduced LOCschedule.ts ×1schedule.ts ×1 · 2 introduced LOCschedule.ts ×1schedule.ts ×2 · 4 introduced LOCschedule.ts ×2schedule.ts ×2 · 5 introduced LOCschedule.ts ×2schedule.ts ×1 · 5 introduced LOCschedule.ts ×1schedule.ts ×1 · 2 introduced LOCschedule.ts ×1schedule.ts ×1 · 2 introduced LOCschedule.ts ×1schedule.ts ×3 · 3 introduced LOCschedule.ts ×3schedule.ts ×1 · 1 introduced LOCschedule.ts ×1schedule.ts ×1 · 5 introduced LOCschedule.ts ×1schedule.ts ×1 · 1 introduced LOCschedule.ts ×1schedule.ts ×1 · 4 introduced LOCschedule.ts ×1schedule.ts ×1 · 1 introduced LOCschedule.ts ×1schedule.ts ×1 · 1 introduced LOCschedule.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 ×3nls.ts ×1 · 1 introduced LOCnls.ts ×1nls.ts ×6 · 13 introduced LOCnls.ts ×6lifecycle.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/chat/common/automations/schedule.ts · 95 LOCautomations/schedule.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…schedule.test|title=Automations - computeNextRunAt daily: rolls into next month at month boundary|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/chat/test/common/automations/schedule.test|title=Automations - computeNextRunAt daily: rolls into next month at month boundary|occurrence=1schedule.test|title=Auto…schedule.test|title=Automations - computeNextRunAt daily: spring-forward day is not skipped|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/chat/test/common/automations/schedule.test|title=Automations - computeNextRunAt daily: spring-forward day is not skipped|occurrence=1schedule.test|title=Auto…schedule.test|title=Automations - computeNextRunAt daily: when target equals now, returns tomorrow (strict >)|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/chat/test/common/automations/schedule.test|title=Automations - computeNextRunAt daily: when target equals now, returns tomorrow (strict >)|occurrence=1schedule.test|title=Auto…schedule.test|title=Automations - computeNextRunAt daily: when target time has passed, returns tomorrow at that time|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/chat/test/common/automations/schedule.test|title=Automations - computeNextRunAt daily: when target time has passed, returns tomorrow at that time|occurrence=1schedule.test|title=Auto…schedule.test|title=Automations - computeNextRunAt daily: when target time is later today, returns today at that time|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/chat/test/common/automations/schedule.test|title=Automations - computeNextRunAt daily: when target time is later today, returns today at that time|occurrence=1schedule.test|title=Auto…minute fields (still produces a next-run with junk values)|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/chat/test/common/automations/schedule.test|title=Automations - computeNextRunAt hourly ignores hour/minute fields (still produces a next-run with junk values)|occurrence=1minute fields (still pro…schedule.test|title=Automations - computeNextRunAt hourly schedules return now + 1h regardless of wall-clock fields|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/chat/test/common/automations/schedule.test|title=Automations - computeNextRunAt hourly schedules return now + 1h regardless of wall-clock fields|occurrence=1schedule.test|title=Auto…schedule.test|title=Automations - computeNextRunAt manual schedules never produce a next-run|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/chat/test/common/automations/schedule.test|title=Automations - computeNextRunAt manual schedules never produce a next-run|occurrence=1schedule.test|title=Auto…weekly|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/chat/test/common/automations/schedule.test|title=Automations - computeNextRunAt rejects invalid hour, minute, or day for daily/weekly|occurrence=1weekly|occurrence=1schedule.test|title=Automations - computeNextRunAt rejects unknown intervals|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/chat/test/common/automations/schedule.test|title=Automations - computeNextRunAt rejects unknown intervals|occurrence=1schedule.test|title=Auto…schedule.test|title=Automations - computeNextRunAt weekly: future weekday this week|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/chat/test/common/automations/schedule.test|title=Automations - computeNextRunAt weekly: future weekday this week|occurrence=1schedule.test|title=Auto…schedule.test|title=Automations - computeNextRunAt weekly: past weekday this week wraps to next week|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/chat/test/common/automations/schedule.test|title=Automations - computeNextRunAt weekly: past weekday this week wraps to next week|occurrence=1schedule.test|title=Auto…schedule.test|title=Automations - computeNextRunAt weekly: same weekday and time in the future returns today|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/chat/test/common/automations/schedule.test|title=Automations - computeNextRunAt weekly: same weekday and time in the future returns today|occurrence=1schedule.test|title=Auto…schedule.test|title=Automations - computeNextRunAt weekly: same weekday but time already passed returns next week|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/chat/test/common/automations/schedule.test|title=Automations - computeNextRunAt weekly: same weekday but time already passed returns next week|occurrence=1schedule.test|title=Auto…schedule.test|title=Automations - computeNextRunAt weekly: spring-forward across the boundary lands on the correct calendar day|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/chat/test/common/automations/schedule.test|title=Automations - computeNextRunAt weekly: spring-forward across the boundary lands on the correct calendar day|occurrence=1schedule.test|title=Auto…Focused concept · schedule.ts ×7 · 48 introduced LOCschedule.ts ×7

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

src/vs/workbench/contrib/chat/common/automations/schedule.ts 48 introduced LOC · 7 ranges

Open complete file

1 > /*--------------------------------------------------------------------------------------------- schedule.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 { IAutomationSchedule } from './automation.js';
7 > import { localize } from '../../../../../nls.js';
8 >
9 > export const DAYS_OF_WEEK: readonly string[] = [
10 > localize('automation.day.sun', "Sunday"),
11 > localize('automation.day.mon', "Monday"),
12 > localize('automation.day.tue', "Tuesday"),
13 > localize('automation.day.wed', "Wednesday"),
14 > localize('automation.day.thu', "Thursday"),
15 > localize('automation.day.fri', "Friday"),
16 > localize('automation.day.sat', "Saturday"),
17 > ];
18 >
19 > /**
20 > * Computes the next fire time for a schedule. Daily/weekly times are
21 > * local wall-clock (not UTC) so DST transitions don't shift them.
22 > * Day advances use `Date` constructor overflow, not milliseconds, to
23 > * avoid skipping spring-forward days. Returns `undefined` for `manual`.
24 > */
25 > export function computeNextRunAt(schedule: IAutomationSchedule, now: Date): Date | undefined {
26 > const { interval, scheduleHour, scheduleMinute, scheduleDay } = schedule;
27 >
28 > switch (interval) {
29 > case 'manual':
30 return undefined;
32 > case 'hourly':
33 return new Date(now.getTime() + 60 * 60 * 1000);
35 > case 'daily': {
36 if (!isValidHourMinute(scheduleHour, scheduleMinute)) {
37 return undefined;
46 return buildLocalDate(now.getFullYear(), now.getMonth(), now.getDate() + 1, scheduleHour, scheduleMinute);
47 }
49 > case 'weekly': {
50 if (!isValidHourMinute(scheduleHour, scheduleMinute)) {
51 return undefined;
63 return buildLocalDate(now.getFullYear(), now.getMonth(), now.getDate() + daysAhead, scheduleHour, scheduleMinute);
64 }
66 > default:
67 return undefined;
68 > } schedule.ts
69 > }
70 >
71 function isValidHourMinute(hour: number, minute: number): boolean {
72 return Number.isInteger(hour) && hour >= 0 && hour <= 23
73 && Number.isInteger(minute) && minute >= 0 && minute <= 59;
74 }
76 > /**
77 > * Builds a Date for a specific local wall-clock time. If the requested time
78 > * falls in a DST spring-forward gap (e.g. 2:30 AM on a day that jumps from
79 > * 2:00 to 3:00), shifts forward in 1-hour increments until a valid time is
80 > * found. Ambiguous fall-back times are resolved to the first occurrence,
81 > * matching JavaScript's default behavior.
82 > */
83 function buildLocalDate(year: number, monthIndex: number, day: number, hour: number, minute: number): Date {
84 const candidate = new Date(year, monthIndex, day, hour, minute, 0, 0);