userActivityRegistry.ts ×3

Frontier kind: Joint frontier

unlabeled · c_b2eda00943e1

5 tests · 7556 LOC · 40 files · introduces 1 test · 96 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
6 ranges96 lines · 2 files
Tests
1 test

Contains — complete concept membership

All code (extent)
1118 ranges7556 lines · 40 files · Browse complete extent
All tests (intent)
5 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 specializationuserActivityService.test|title=UserActivityService markActive sets active whenHeldFor|occurrence=1 · 0 introduced LOCuserActivityService.test…userActivityService.ts ×1 · 4 introduced LOCuserActivityService.ts ×…userActivityService.ts ×1 · 2 introduced LOCuserActivityService.ts ×…userActivityService.ts ×4 · 22 introduced LOCuserActivityService.ts ×…instantiationServiceMock.ts ×2 · 3 introduced LOCinstantiationServiceMock…instantiationServiceMock.ts ×2 · 5 introduced LOCinstantiationServiceMock…instantiationServiceMock.ts ×18 · 78 introduced LOCinstantiationServiceMock…instantiationService.ts ×1 · 9 introduced LOCinstantiationService.ts …serviceCollection.ts ×3 · 6 introduced LOCserviceCollection.ts ×3instantiationService.ts ×21 · 109 introduced LOCinstantiationService.ts …async.ts ×1 · 3 introduced LOCasync.ts ×1async.ts ×3 · 4 introduced LOCasync.ts ×3async.ts ×3 · 10 introduced LOCasync.ts ×3async.ts ×1 · 5 introduced LOCasync.ts ×1serviceCollection.ts ×5 · 20 introduced LOCserviceCollection.ts ×5async.ts ×202 · 1247 introduced LOCasync.ts ×202resources.ts ×23 · 253 introduced LOCresources.ts ×23extensions.ts ×1 · 35 introduced LOCextensions.ts ×1network.ts ×20 · 292 introduced LOCnetwork.ts ×20descriptors.ts ×1 · 4 introduced LOCdescriptors.ts ×1extpath.ts ×17 · 91 introduced LOCextpath.ts ×17descriptors.ts ×2 · 17 introduced LOCdescriptors.ts ×2strings.ts ×101 · 542 introduced LOCstrings.ts ×101event.ts ×3 · 19 introduced LOCevent.ts ×3cancellation.ts ×18 · 90 introduced LOCcancellation.ts ×18lifecycle.ts ×2 · 3 introduced LOClifecycle.ts ×2lifecycle.test|title=Lifecycle dispose disposable array|occurrence=1, lifecycle.test|title=Lifecycle Action bar has broken accessibility #100273|occurrence=1 · 0 introduced LOClifecycle.test|title=Lif…event.ts ×1 · 1 introduced LOCevent.ts ×1event.ts ×4 · 9 introduced LOCevent.ts ×4event.ts ×2 · 4 introduced LOCevent.ts ×2event.ts ×2 · 6 introduced LOCevent.ts ×2event.ts ×93 · 864 introduced LOCevent.ts ×93lifecycle.ts ×1 · 6 introduced LOClifecycle.ts ×1utils.ts ×1 · 2 introduced LOCutils.ts ×1graph.ts ×12 · 42 introduced LOCgraph.ts ×12utils.ts ×3 · 9 introduced LOCutils.ts ×3instantiation.ts ×4 · 10 introduced LOCinstantiation.ts ×4lifecycle.ts ×1 · 3 introduced LOClifecycle.ts ×1linkedList.ts ×13 · 44 introduced LOClinkedList.ts ×13instantiation.ts ×5 · 111 introduced LOCinstantiation.ts ×5lifecycle.ts ×1 · 4 introduced LOClifecycle.ts ×1lifecycle.ts ×2 · 6 introduced LOClifecycle.ts ×2lifecycle.ts ×2 · 4 introduced LOClifecycle.ts ×2lifecycle.ts ×1 · 6 introduced LOClifecycle.ts ×1lifecycle.ts ×1 · 1 introduced LOClifecycle.ts ×1lifecycle.ts ×1 · 3 introduced LOClifecycle.ts ×1lifecycle.ts ×3 · 9 introduced LOClifecycle.ts ×3lifecycle.ts ×1 · 7 introduced LOClifecycle.ts ×1lifecycle.ts ×4 · 7 introduced LOClifecycle.ts ×4lifecycle.ts ×4 · 8 introduced LOClifecycle.ts ×4lifecycle.ts ×6 · 16 introduced LOClifecycle.ts ×6lifecycle.ts ×2 · 2 introduced LOClifecycle.ts ×2lazy.ts ×1 · 2 introduced LOClazy.ts ×1lifecycle.ts ×1 · 3 introduced LOClifecycle.ts ×1lifecycle.ts ×3 · 3 introduced LOClifecycle.ts ×3lazy.ts ×3 · 37 introduced LOClazy.ts ×3lifecycle.ts ×1 · 2 introduced LOClifecycle.ts ×1lifecycle.ts ×1 · 2 introduced LOClifecycle.ts ×1uint.ts ×2 · 43 introduced LOCuint.ts ×2iterator.ts ×1 · 2 introduced LOCiterator.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/async.ts · 2749 LOCcommon/async.tssrc/vs/base/common/cache.ts · 153 LOCcommon/cache.tssrc/vs/base/common/cancellation.ts · 206 LOCcommon/cancellation.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/event.ts · 1964 LOCcommon/event.tssrc/vs/base/common/extpath.ts · 433 LOCcommon/extpath.tssrc/vs/base/common/functional.ts · 32 LOCcommon/functional.tssrc/vs/base/common/iterator.ts · 194 LOCcommon/iterator.tssrc/vs/base/common/lazy.ts · 57 LOCcommon/lazy.tssrc/vs/base/common/lifecycle.ts · 974 LOCcommon/lifecycle.tssrc/vs/base/common/linkedList.ts · 151 LOCcommon/linkedList.tssrc/vs/base/common/map.ts · 1016 LOCcommon/map.tssrc/vs/base/common/marshallingIds.ts · 33 LOCcommon/marshallingIds.tssrc/vs/base/common/network.ts · 440 LOCcommon/network.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/resources.ts · 444 LOCcommon/resources.tssrc/vs/base/common/stopwatch.ts · 41 LOCcommon/stopwatch.tssrc/vs/base/common/strings.ts · 1413 LOCcommon/strings.tssrc/vs/base/common/symbols.ts · 9 LOCcommon/symbols.tssrc/vs/base/common/types.ts · 410 LOCcommon/types.tssrc/vs/base/common/uint.ts · 59 LOCcommon/uint.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/descriptors.ts · 21 LOCcommon/descriptors.tssrc/vs/platform/instantiation/common/extensions.ts · 37 LOCcommon/extensions.tssrc/vs/platform/instantiation/common/graph.ts · 111 LOCcommon/graph.tssrc/vs/platform/instantiation/common/instantiation.ts · 130 LOCcommon/instantiation.tssrc/vs/platform/instantiation/common/instantiationService.ts · 475 LOCcommon/instantiationServ…src/vs/platform/instantiation/common/serviceCollection.ts · 32 LOCcommon/serviceCollection…src/vs/platform/instantiation/test/common/instantiationServiceMock.ts · 198 LOCcommon/instantiationServ…src/vs/workbench/services/userActivity/common/userActivityRegistry.ts · 23 LOCcommon/userActivityRegis…src/vs/workbench/services/userActivity/common/userActivityService.ts · 103 LOCcommon/userActivityServi…lifecycle.test|title=Lifecycle Action bar has broken accessibility #100273|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/lifecycle.test|title=Lifecycle Action bar has broken accessibility #100273|occurrence=1lifecycle.test|title=Lif…lifecycle.test|title=Lifecycle dispose disposable array|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/lifecycle.test|title=Lifecycle dispose disposable array|occurrence=1lifecycle.test|title=Lif…userActivityService.test|title=UserActivityService isActive should be true initially|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/services/userActivity/test/common/userActivityService.test|title=UserActivityService isActive should be true initially|occurrence=1userActivityService.test…userActivityService.test|title=UserActivityService markActive sets active whenHeldFor|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/services/userActivity/test/common/userActivityService.test|title=UserActivityService markActive sets active whenHeldFor|occurrence=1userActivityService.test…userActivityService.test|title=UserActivityService markActive should be inactive when all handles gone|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/services/userActivity/test/common/userActivityService.test|title=UserActivityService markActive should be inactive when all handles gone|occurrence=1userActivityService.test…userActivityService.test|title=UserActivityService markActive whenHeldFor before triggers|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/services/userActivity/test/common/userActivityService.test|title=UserActivityService markActive whenHeldFor before triggers|occurrence=1userActivityService.test…userActivityService.test|title=UserActivityService markActive with extendOnly only extends if already active|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/services/userActivity/test/common/userActivityService.test|title=UserActivityService markActive with extendOnly only extends if already active|occurrence=1userActivityService.test…Focused concept · userActivityRegistry.ts ×3 · 96 introduced LOCuserActivityRegistry.ts …

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.

1 test introduced at this concept.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

2 files ranked by introduced lines: 96 introduced LOC across 6 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/workbench/services/userActivity/common/userActivityService.ts 79 introduced LOC · 3 ranges

Open complete file

1 > /*--------------------------------------------------------------------------------------------- userActivityService.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 { disposableTimeout, RunOnceScheduler, runWhenGlobalIdle } from '../../../../base/common/async.js';
7 > import { Emitter, Event } from '../../../../base/common/event.js';
8 > import { Disposable, DisposableStore, IDisposable, toDisposable } from '../../../../base/common/lifecycle.js';
9 > import { InstantiationType, registerSingleton } from '../../../../platform/instantiation/common/extensions.js';
10 > import { IInstantiationService, createDecorator } from '../../../../platform/instantiation/common/instantiation.js';
11 > import { userActivityRegistry } from './userActivityRegistry.js';
12 >
13 > export interface IMarkActiveOptions {
14 > whenHeldFor?: number;
15 > /**
16 > * Only consider this progress if the state is already active. Used to avoid
17 > * background work from incorrectly marking the user as active (#237386)
18 > */
19 > extendOnly?: boolean;
20 > }
21 >
22 > /**
23 > * Service that observes user activity in the window.
24 > */
25 > export interface IUserActivityService {
26 > _serviceBrand: undefined;
27 >
28 > /**
29 > * Whether the user is currently active.
30 > */
31 > readonly isActive: boolean;
32 >
33 > /**
34 > * Fires when the activity state changes.
35 > */
36 > readonly onDidChangeIsActive: Event<boolean>;
37 >
38 > /**
39 > * Marks the user as being active until the Disposable is disposed of.
40 > * Multiple consumers call this method; the user will only be considered
41 > * inactive once all consumers have disposed of their Disposables.
42 > */
43 > markActive(opts?: IMarkActiveOptions): IDisposable;
44 > }
45 >
46 > const MARK_INACTIVE_DEBOUNCE = 10_000;
47 >
48 > export const IUserActivityService = createDecorator<IUserActivityService>('IUserActivityService');
49 >
50 > export class UserActivityService extends Disposable implements IUserActivityService {
51 > declare readonly _serviceBrand: undefined;
52 > private readonly markInactive = this._register(new RunOnceScheduler(() => {
53 this.isActive = false;
54 this.changeEmitter.fire(false);
55 > }, MARK_INACTIVE_DEBOUNCE)); userActivityService.ts
56 >
57 > private readonly changeEmitter = this._register(new Emitter<boolean>);
58 > private active = 0;
59 >
60 > /**
61 > * @inheritdoc
62 > *
63 > * Note: initialized to true, since the user just did something to open the
64 > * window. The bundled DomActivityTracker will initially assume activity
65 > * as well in order to unset this if the window gets abandoned.
66 > */
67 > public isActive = true;
68 >
69 > /** @inheritdoc */
70 > readonly onDidChangeIsActive: Event<boolean> = this.changeEmitter.event;
71 >
72 > constructor(@IInstantiationService instantiationService: IInstantiationService) {
73 > super();
74 > this._register(runWhenGlobalIdle(() => userActivityRegistry.take(this, instantiationService)));
75 > }
76 >
77 > /** @inheritdoc */
78 > markActive(opts?: IMarkActiveOptions): IDisposable {
79 if (opts?.extendOnly && !this.isActive) {
80 return Disposable.None;
99 });
100 }
102 >
103 > registerSingleton(IUserActivityService, UserActivityService, InstantiationType.Delayed);
src/vs/workbench/services/userActivity/common/userActivityRegistry.ts 17 introduced LOC · 3 ranges

Open complete file

1 > /*--------------------------------------------------------------------------------------------- userActivityRegistry.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 { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js';
7 > import { IUserActivityService } from './userActivityService.js';
8 >
9 > class UserActivityRegistry {
10 > private todo: { new(s: IUserActivityService, ...args: unknown[]): unknown }[] = [];
11 >
12 > public add = (ctor: { new(s: IUserActivityService, ...args: unknown[]): unknown }) => {
13 this.todo.push(ctor);
14 };
16 > public take(userActivityService: IUserActivityService, instantiation: IInstantiationService) {
17 this.add = ctor => instantiation.createInstance(ctor, userActivityService);
18 this.todo.forEach(this.add);
19 this.todo = [];
20 }
22 >
23 > export const userActivityRegistry = new UserActivityRegistry();