chatSessionStore.ts ×7

Frontier kind: Joint frontier

unlabeled · c_64b17b9b64fe

2 tests · 44080 LOC · 189 files · introduces 1 test · 29 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
8 ranges29 lines · 2 files
Tests
1 test

Contains — complete concept membership

All code (extent)
4128 ranges44080 lines · 189 files · Browse complete extent
All tests (intent)
2 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.

1 test introduced at this concept.

Introduced code

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

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

src/vs/workbench/contrib/chat/common/model/chatSessionStore.ts 27 introduced LOC · 7 ranges

Open complete file

114 const newStorageRoot = isNewWorkspaceEmpty ?
115 joinPath(this.userDataProfilesService.defaultProfile.globalStorageHome, 'emptyWindowChatSessions') :
116 > joinPath(this.environmentService.workspaceStorageHome, newWorkspaceId, 'chatSessions'); chatSessionStore.ts
117
118 // If the storage roots are identical, there is nothing to migrate
121 return;
122 }
124 > // Update storage root for the new workspace
125 > this.storageRoot = newStorageRoot;
126 >
127 > // Migrate session files from old to new location
128 > await this.migrateSessionsToNewWorkspace(oldStorageRoot, wasEmptyWindow, isNewWorkspaceEmpty);
129 }
130
131 private async migrateSessionsToNewWorkspace(oldStorageRoot: URI, wasEmptyWindow: boolean, isNewWorkspaceEmpty: boolean): Promise<void> {
132 > try { chatSessionStore.ts
133 > // Check if old storage location exists
134 > const oldStorageExists = await this.fileService.exists(oldStorageRoot);
135 > if (!oldStorageExists) {
136 this.logService.info(`ChatSessionStore: Old storage location does not exist, skipping migration`);
137 return;
138 }
140 > // Read all session files from old location
141 > const oldDirectory = await this.fileService.resolve(oldStorageRoot);
142 > if (!oldDirectory.children) {
143 > this.logService.info(`ChatSessionStore: No children in old storage location, skipping migration`);
144 > return;
145 > }
146
147 this.logService.info(`ChatSessionStore: Found ${oldDirectory.children.length} files in old storage location`);
168 }
169
170 > this.logService.info(`ChatSessionStore: Copied ${migratedCount} chat session files from ${wasEmptyWindow ? 'empty window' : oldStorageRoot.toString()} to ${isNewWorkspaceEmpty ? 'empty window' : this.storageRoot.toString()} (originals preserved at old location)`); chatSessionStore.ts
171 >
172 > // Clear the index cache and flush it to the new storage scope
173 > this.indexCache = undefined;
174 > try {
175 > await this.flushIndex();
176 } catch (e) {
177 this.reportError('migrateWorkspace', 'Error flushing chat session index after workspace migration', e);
178 }
180 > } catch (e) {
181 this.reportError('migrateWorkspace', 'Error migrating chat sessions to new workspace', e);
182 }
184
185 async storeSessions(sessions: ChatModel[]): Promise<void> {
src/vs/workbench/test/common/workbenchTestServices.ts 2 introduced LOC · 1 range

Open complete file

566 resolve(resource: URI, _options?: IResolveFileOptions): Promise<IFileStat>;
567 async resolve(resource: URI, _options?: IResolveFileOptions): Promise<IFileStat> {
568 > return createFileStat(resource, this.readonly); workbenchTestServices.ts
569 > }
570
571 stat(resource: URI): Promise<IFileStatWithPartialMetadata> {