filePolicyService.ts ×6

Frontier kind: Code frontier

unlabeled · c_477731afc0f8

38 tests · 14990 LOC · 71 files · introduces 0 tests · 28 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
6 ranges28 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
2250 ranges14990 lines · 71 files · Browse complete extent
All tests (intent)
38 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: 28 introduced LOC across 6 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/platform/policy/common/filePolicyService.ts 28 introduced LOC · 6 ranges

Open complete file

1 > /*--------------------------------------------------------------------------------------------- filePolicyService.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 { ThrottledDelayer } from '../../../base/common/async.js';
7 > import { Event } from '../../../base/common/event.js';
8 > import { Iterable } from '../../../base/common/iterator.js';
9 > import { PolicyName } from '../../../base/common/policy.js';
10 > import { isObject } from '../../../base/common/types.js';
11 > import { URI } from '../../../base/common/uri.js';
12 > import { FileOperationError, FileOperationResult, IFileService } from '../../files/common/files.js';
13 > import { ILogService } from '../../log/common/log.js';
14 > import { AbstractPolicyService, IPolicyService, PolicyValue } from './policy.js';
15 >
16 function keysDiff<T>(a: Map<string, T>, b: Map<string, T>): string[] {
17 const result: string[] = [];
25 return result;
26 }
28 > export class FilePolicyService extends AbstractPolicyService implements IPolicyService {
29 >
30 > private readonly throttledDelayer = this._register(new ThrottledDelayer(500));
31 >
32 > constructor(
33 private readonly file: URI,
34 @IFileService private readonly fileService: IFileService,
41 this._register(onDidChangePolicyFile(() => this.throttledDelayer.trigger(() => this.refresh())));
42 }
44 > protected async _updatePolicyDefinitions(): Promise<void> {
45 await this.refresh();
46 }
48 > private async read(): Promise<Map<PolicyName, PolicyValue>> {
49 const policies = new Map<PolicyName, PolicyValue>();
50
70 return policies;
71 }
73 > private async refresh(): Promise<void> {
74 const policies = await this.read();
75 const diff = keysDiff(this.policies, policies);