workspacePluginSettingsService.ts ×6

Frontier kind: Code frontier

unlabeled · c_7d5b7fe2b867

190 tests · 25530 LOC · 134 files · introduces 0 tests · 96 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
6 ranges96 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
2608 ranges25530 lines · 134 files · Browse complete extent
All tests (intent)
190 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: 96 introduced LOC across 6 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/workbench/contrib/chat/common/plugins/workspacePluginSettingsService.ts 96 introduced LOC · 6 ranges

Open complete file

1 > /*--------------------------------------------------------------------------------------------- workspacePluginSettingsService.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 { parse as parseJSONC } from '../../../../../base/common/json.js';
7 > import { RunOnceScheduler } from '../../../../../base/common/async.js';
8 > import { Disposable, DisposableStore } from '../../../../../base/common/lifecycle.js';
9 > import { autorun, derived, IObservable, observableFromEvent, observableValue } from '../../../../../base/common/observable.js';
10 > import { joinPath } from '../../../../../base/common/resources.js';
11 > import { URI } from '../../../../../base/common/uri.js';
12 > import { IFileService } from '../../../../../platform/files/common/files.js';
13 > import { createDecorator } from '../../../../../platform/instantiation/common/instantiation.js';
14 > import { ILogService } from '../../../../../platform/log/common/log.js';
15 > import { IWorkspaceContextService } from '../../../../../platform/workspace/common/workspace.js';
16 > import { CLAUDE_CONFIG_FOLDER } from '../promptSyntax/config/promptFileLocations.js';
17 > import { IMarketplaceReference, parseMarketplaceObjectEntry } from './marketplaceReference.js';
18 >
19 > const SETTINGS_FILENAME = 'settings.json';
20 > const SETTINGS_LOCAL_FILENAME = 'settings.local.json';
21 >
22 > /** Copilot CLI settings folder inside `.github/`. */
23 > const COPILOT_CONFIG_FOLDER = '.github/copilot';
24 >
25 > /**
26 > * Minimal representation of a marketplace entry from `extraKnownMarketplaces`.
27 > */
28 > export interface IWorkspaceMarketplaceEntry {
29 > readonly name: string;
30 > readonly reference: IMarketplaceReference;
31 > }
32 >
33 > export const IWorkspacePluginSettingsService = createDecorator<IWorkspacePluginSettingsService>('workspacePluginSettingsService');
34 >
35 > export interface IWorkspacePluginSettingsService {
36 > readonly _serviceBrand: undefined;
37 >
38 > /**
39 > * Marketplace references parsed from `extraKnownMarketplaces` in workspace
40 > * settings files (`.claude/settings.json`, `.github/copilot/settings.json`).
41 > */
42 > readonly extraMarketplaces: IObservable<readonly IWorkspaceMarketplaceEntry[]>;
43 >
44 > /**
45 > * Plugin recommendation map parsed from `enabledPlugins` in workspace
46 > * settings files.
47 > * Keys are `"pluginName@marketplaceName"`, values indicate recommendation.
48 > */
49 > readonly enabledPlugins: IObservable<ReadonlyMap<string, boolean>>;
50 > }
51 >
52 > // --- Parsing helpers ---------------------------------------------------------
53 >
54 > /**
55 > * Parses `enabledPlugins` from a JSON object.
56 > */
57 function parseEnabledPlugins(json: unknown): ReadonlyMap<string, boolean> {
58 const result = new Map<string, boolean>();
71 return result;
72 }
74 > /**
75 > * Parses `extraKnownMarketplaces` from a JSON object.
76 > */
77 function parseExtraMarketplaces(json: unknown, logPrefix: string, logService: ILogService): readonly IWorkspaceMarketplaceEntry[] {
78 const entries: IWorkspaceMarketplaceEntry[] = [];
100 return entries;
101 }
103 > // --- Settings reader (reusable per config folder) ----------------------------
104 >
105 > interface IWorkspaceSettingsData {
106 > readonly marketplaces: readonly IWorkspaceMarketplaceEntry[];
107 > readonly enabledPlugins: ReadonlyMap<string, boolean>;
108 > }
109 >
110 > const EMPTY_DATA: IWorkspaceSettingsData = { marketplaces: [], enabledPlugins: new Map() };
111 >
112 > /**
113 > * Reads `enabledPlugins` and `extraKnownMarketplaces` from a pair of
114 > * `settings.json` / `settings.local.json` files inside a given config
115 > * folder (e.g. `.claude/` or `.github/copilot/`) across all workspace
116 > * folders. Watches for changes and exposes results as an observable.
117 > */
118 > class WorkspaceSettingsReader extends Disposable {
119 >
120 > private readonly _data = observableValue<IWorkspaceSettingsData>('data', EMPTY_DATA);
121 > readonly data: IObservable<IWorkspaceSettingsData> = this._data;
122 >
123 > constructor(
124 /** Workspace-relative config folder (e.g. `.claude`). */
125 configFolder: string,
160 }));
161 }
163 > private async _readSettings(dirs: readonly URI[], logPrefix: string, fileService: IFileService): Promise<void> {
164 const allMarketplaces: IWorkspaceMarketplaceEntry[] = [];
165 const mergedEnabled = new Map<string, boolean>();
199 this._data.set({ marketplaces: allMarketplaces, enabledPlugins: mergedEnabled }, undefined);
200 }
202 >
203 > // --- Aggregating service implementation --------------------------------------
204 >
205 > export class WorkspacePluginSettingsService extends Disposable implements IWorkspacePluginSettingsService {
206 > declare readonly _serviceBrand: undefined;
207 >
208 > readonly extraMarketplaces: IObservable<readonly IWorkspaceMarketplaceEntry[]>;
209 > readonly enabledPlugins: IObservable<ReadonlyMap<string, boolean>>;
210 >
211 > constructor(
212 @IFileService fileService: IFileService,
213 @IWorkspaceContextService workspaceContextService: IWorkspaceContextService,