chatServiceImpl.ts ×6

Frontier kind: Code frontier

unlabeled · c_bbc485c9fb3e

65 tests · 70109 LOC · 309 files · introduces 0 tests · 50 LOC · 3 files

Introduces — evidence that enters the hierarchy at this concept

Code
9 ranges50 lines · 3 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
5673 ranges70109 lines · 309 files · Browse complete extent
All tests (intent)
65 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.

3 files ranked by introduced lines: 50 introduced LOC across 9 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.ts 42 introduced LOC · 6 ranges

Open complete file

234 */
235 waitForModelDisposals(): Promise<void> {
236 > return this._sessionModels.waitForModelDisposals(); chatServiceImpl.ts
237 > }
238
239 private get isEmptyWindow(): boolean {
243
244 constructor(
245 > @IStorageService private readonly storageService: IStorageService, chatServiceImpl.ts
246 > @ILogService private readonly logService: ILogService,
247 > @ITelemetryService private readonly telemetryService: ITelemetryService,
248 > @IExtensionService private readonly extensionService: IExtensionService,
249 > @IInstantiationService private readonly instantiationService: IInstantiationService,
250 > @IWorkspaceContextService private readonly workspaceContextService: IWorkspaceContextService,
251 > @IChatSlashCommandService private readonly chatSlashCommandService: IChatSlashCommandService,
252 > @IChatAgentService private readonly chatAgentService: IChatAgentService,
253 > @IConfigurationService private readonly configurationService: IConfigurationService,
254 > @IChatTransferService private readonly chatTransferService: IChatTransferService,
255 > @IChatSessionsService private readonly chatSessionService: IChatSessionsService,
256 > @IMcpService private readonly mcpService: IMcpService,
257 > @IPromptsService private readonly promptsService: IPromptsService,
258 > @IChatEntitlementService private readonly chatEntitlementService: IChatEntitlementService,
259 > @ILanguageModelsService private readonly languageModelsService: ILanguageModelsService,
260 > @IChatDebugService private readonly chatDebugService: IChatDebugService,
261 > ) {
262 > super();
263 >
264 > this._sessionModels = this._register(instantiationService.createInstance(ChatModelStore, {
265 > createModel: (props: IStartSessionProps) => this._startSession(props),
266 > willDisposeModel: async (model: ChatModel) => {
267 const localSessionId = LocalChatSessionUri.parseLocalSessionId(model.sessionResource);
268 if (localSessionId && this.shouldStoreSession(model)) {
282 }
283 }
284 > })); chatServiceImpl.ts
285 > this._register(this._sessionModels.onDidDisposeModel(model => {
286 clearChatMarks(model.sessionResource);
287 this.chatDebugService.endSession(model.sessionResource);
290 this.chatSessionService.clearMaterializedSessionResource(model.sessionResource);
291 this._onDidDisposeSession.fire({ sessionResources: [model.sessionResource], reason: 'cleared' });
292 > })); chatServiceImpl.ts
293 >
294 > this._chatServiceTelemetry = this.instantiationService.createInstance(ChatServiceTelemetry);
295 > this._chatSessionStore = this._register(this.instantiationService.createInstance(ChatSessionStore));
296 > this._chatSessionStore.migrateDataIfNeeded(() => this.migrateData());
297 >
298 > const transferredData = this._chatSessionStore.getTransferredSessionData();
299 > if (transferredData) {
300 this.trace('constructor', `Transferred session ${transferredData}`);
301 this._transferredSessionResource = transferredData;
302 }
304 > this._register(storageService.onWillSaveState(() => this.saveState()));
305 >
306 > this.chatModels = derived(this, reader => [...this._sessionModels.observable.read(reader).values()]);
307 >
308 > this.requestInProgressObs = derived(reader => {
309 const models = this._sessionModels.observable.read(reader).values();
310 return Iterable.some(models, model => model.requestInProgress.read(reader));
311 > }); chatServiceImpl.ts
312 > }
313
314 public get editingSessions() {
src/vs/workbench/contrib/chat/common/model/chatSessionStore.ts 6 introduced LOC · 2 ranges

Open complete file

603
604 async migrateDataIfNeeded(getInitialData: () => ISerializableChatsData | undefined): Promise<void> {
605 > await this.storeQueue.queue(async () => { chatSessionStore.ts
606 > const data = this.storageService.get(ChatIndexStorageKey, this.getIndexStorageScope(), undefined);
607 > const needsMigrationFromStorageService = !data;
608 > if (needsMigrationFromStorageService) {
609 const initialData = getInitialData();
610 if (initialData) {
612 }
613 }
615 > }
616
617 private async migrate(initialData: ISerializableChatsData): Promise<void> {
src/vs/workbench/contrib/chat/common/chatService/chatServiceTelemetry.ts 2 introduced LOC · 1 range

Open complete file

189 export class ChatServiceTelemetry {
190 constructor(
191 > @ITelemetryService private readonly telemetryService: ITelemetryService, chatServiceTelemetry.ts
192 > ) { }
193
194 notifyUserAction(action: IChatUserActionEvent): void {