workspacePluginSettingsService.ts ×8

Frontier kind: Code frontier

unlabeled · c_9c1153f10203

12 tests · 29914 LOC · 155 files · introduces 0 tests · 79 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
8 ranges79 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
3457 ranges29914 lines · 155 files · Browse complete extent
All tests (intent)
12 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: 79 introduced LOC across 8 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/workbench/contrib/chat/common/plugins/workspacePluginSettingsService.ts 79 introduced LOC · 8 ranges

Open complete file

122
123 constructor(
124 > /** Workspace-relative config folder (e.g. `.claude`). */ workspacePluginSettingsService.ts
125 > configFolder: string,
126 > logPrefix: string,
127 > fileService: IFileService,
128 > workspaceContextService: IWorkspaceContextService,
129 > private readonly _logService: ILogService,
130 > ) {
131 > super();
132 >
133 > const settingsDirs = observableFromEvent(
134 > this,
135 > workspaceContextService.onDidChangeWorkspaceFolders,
136 > () => workspaceContextService.getWorkspace().folders.map(f => f.uri.path ? joinPath(f.uri, configFolder) : joinPath(f.uri.with({ path: '/' }), configFolder)),
137 > );
138 >
139 > const watcherStore = this._register(new DisposableStore());
140 > this._register(autorun(reader => {
141 > const dirs = settingsDirs.read(reader);
142 > watcherStore.clear();
143 >
144 > // Coalesce rapid file-change events into a single read.
145 > const scheduler = new RunOnceScheduler(() => this._readSettings(dirs, logPrefix, fileService), 100);
146 > watcherStore.add(scheduler);
147 >
148 > for (const dir of dirs) {
149 > const watcher = fileService.createWatcher(dir, { recursive: false, excludes: [] });
150 > watcherStore.add(watcher);
151 > watcherStore.add(watcher.onDidChange(e => {
152 if (e.affects(joinPath(dir, SETTINGS_FILENAME)) || e.affects(joinPath(dir, SETTINGS_LOCAL_FILENAME))) {
153 scheduler.schedule();
154 }
156 > }
157 >
158 > // Perform initial read immediately.
159 > this._readSettings(dirs, logPrefix, fileService);
160 > }));
161 > }
162
163 private async _readSettings(dirs: readonly URI[], logPrefix: string, fileService: IFileService): Promise<void> {
164 > const allMarketplaces: IWorkspaceMarketplaceEntry[] = []; workspacePluginSettingsService.ts
165 > const mergedEnabled = new Map<string, boolean>();
166 >
167 > for (const dir of dirs) {
168 > const sharedUri = joinPath(dir, SETTINGS_FILENAME);
169 > const localUri = joinPath(dir, SETTINGS_LOCAL_FILENAME);
170 >
171 > for (const uri of [sharedUri, localUri]) {
172 > try {
173 > const content = await fileService.readFile(uri);
174 const json = parseJSONC(content.value.toString());
175
176 > if (!json || typeof json !== 'object') { workspacePluginSettingsService.ts
177 continue;
178 }
191 mergedEnabled.set(key, value);
192 }
194 > this._logService.debug(`${logPrefix} Could not read ${uri.toString()}`);
195 > }
196 > }
197 > }
198 >
199 > this._data.set({ marketplaces: allMarketplaces, enabledPlugins: mergedEnabled }, undefined);
200 > }
201 }
202
210
211 constructor(
212 > @IFileService fileService: IFileService, workspacePluginSettingsService.ts
213 > @IWorkspaceContextService workspaceContextService: IWorkspaceContextService,
214 > @ILogService logService: ILogService,
215 > ) {
216 > super();
217 >
218 > const claudeReader = this._register(new WorkspaceSettingsReader(
219 > CLAUDE_CONFIG_FOLDER, '[ClaudePluginSettings]',
220 > fileService, workspaceContextService, logService,
221 > ));
222 >
223 > const copilotReader = this._register(new WorkspaceSettingsReader(
224 > COPILOT_CONFIG_FOLDER, '[CopilotPluginSettings]',
225 > fileService, workspaceContextService, logService,
226 > ));
227 >
228 > // Merge marketplaces from all readers, deduplicating by canonical ID.
229 > this.extraMarketplaces = derived(reader => {
230 const claude = claudeReader.data.read(reader).marketplaces;
231 const copilot = copilotReader.data.read(reader).marketplaces;
237 }
238 return [...byCanonicalId.values()];
240 >
241 > // Merge enabledPlugins from all readers. Claude entries take
242 > // precedence for keys that exist in both (first-writer wins).
243 > this.enabledPlugins = derived(reader => {
244 const claude = claudeReader.data.read(reader).enabledPlugins;
245 const copilot = copilotReader.data.read(reader).enabledPlugins;