chatServiceImpl.ts ×3

Frontier kind: Joint frontier

unlabeled · c_f87cdad558ec

1 test · 72400 LOC · 309 files · introduces 1 test · 41 LOC · 4 files

Introduces — evidence that enters the hierarchy at this concept

Code
8 ranges41 lines · 4 files
Tests
1 test

Contains — complete concept membership

All code (extent)
6301 ranges72400 lines · 309 files · Browse complete extent
All tests (intent)
1 testBrowse 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.

1 test introduced at this concept.

Introduced code

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

4 files ranked by introduced lines: 41 introduced LOC across 8 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.ts 28 introduced LOC · 3 ranges

Open complete file

336
337 private saveState(): void {
338 > if (!this._saveModelsEnabled) { chatServiceImpl.ts
339 return;
340 }
342 > const liveLocalChats = Array.from(this._sessionModels.values())
343 > .filter(session => this.shouldStoreSession(session));
344 >
345 > const liveNonLocalChats = Array.from(this._sessionModels.values())
346 > .filter(session => !LocalChatSessionUri.parseLocalSessionId(session.sessionResource));
347 >
348 > // Synchronously update the index for all live sessions and flush it to
349 > // storage. This is critical because `onWillSaveState` is synchronous —
350 > // after this handler returns the storage service flushes its databases.
351 > // The async file-write work kicked off below may complete after the
352 > // flush, but the index must be up-to-date before the flush happens so
353 > // that sessions are discoverable after a reload.
354 > this._chatSessionStore.updateAndFlushIndexSync(liveLocalChats, liveNonLocalChats);
355 >
356 > // Kick off async file writes for session data.
357 > this._chatSessionStore.storeSessions(liveLocalChats);
358 > this._chatSessionStore.storeSessionsMetadataOnly(liveNonLocalChats);
359 > }
360
361 /**
486 .filter(entry => !this._sessionModels.has(LocalChatSessionUri.forSession(entry.sessionId)) && entry.initialLocation === ChatAgentLocation.Chat && !entry.isEmpty)
487 .map((entry): IChatDetail => {
488 > const sessionResource = LocalChatSessionUri.forSession(entry.sessionId); chatServiceImpl.ts
489 > const { workingDirectory: workingDirectoryStr, ...rest } = entry;
490 > return ({
491 > ...rest,
492 > sessionResource,
493 > isActive: this._sessionModels.has(sessionResource),
494 > workingDirectory: workingDirectoryStr ? URI.parse(workingDirectoryStr) : undefined,
495 > });
496 });
497 }
src/vs/workbench/contrib/chat/common/model/chatSessionStore.ts 9 introduced LOC · 3 ranges

Open complete file

737 */
738 updateAndFlushIndexSync(localSessions: ChatModel[], externalSessions: ChatModel[]): void {
739 > const index = this.internalGetIndex(); chatSessionStore.ts
740 > for (const session of localSessions) {
741 > index.entries[session.sessionId] = getSessionMetadataSync(session);
742 > }
743 > for (const session of externalSessions) {
744 const externalSessionId = session.sessionResource.toString();
745 index.entries[externalSessionId] = getSessionMetadataSync(session);
746 }
747 > try { chatSessionStore.ts
748 > this.storageService.store(ChatIndexStorageKey, index, this.getIndexStorageScope(), StorageTarget.MACHINE);
749 > } catch (e) {
750 this.reportError('indexWrite', 'Error writing index synchronously', e);
751 }
753
754 public getChatStorageFolder(): URI {
src/vs/platform/storage/common/storage.ts 2 introduced LOC · 1 range

Open complete file

436
437 protected emitWillSaveState(reason: WillSaveStateReason): void {
438 > this._onWillSaveState.fire({ reason }); storage.ts
439 > }
440
441 get(key: string, scope: StorageScope, fallbackValue: string): string;
src/vs/workbench/test/common/workbenchTestServices.ts 2 introduced LOC · 1 range

Open complete file

168
169 testEmitWillSaveState(reason: WillSaveStateReason): void {
170 > super.emitWillSaveState(reason); workbenchTestServices.ts
171 > }
172 }
173