chatSessionStore.ts ×7

Frontier kind: Code frontier

unlabeled · c_96b8f99e2005

9 tests · 43898 LOC · 188 files · introduces 0 tests · 25 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
10 ranges25 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
4091 ranges43898 lines · 188 files · Browse complete extent
All tests (intent)
9 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.

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

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

Open complete file

634
635 private async readSessionFromLocation(flatStorageLocation: URI, logStorageLocation: URI | undefined, sessionId: string): Promise<ISerializedChatDataReference | undefined> {
636 > let fromLocation = flatStorageLocation; chatSessionStore.ts
637 > let rawData: VSBuffer | undefined;
638 >
639 > if (logStorageLocation) {
640 try {
641 rawData = (await this.fileService.readFile(logStorageLocation)).value;
645 }
646 }
648 > if (!rawData) {
649 try {
650 rawData = (await this.fileService.readFile(flatStorageLocation)).value;
658 }
659 }
661 > if (!rawData) {
662 return undefined;
663 }
665 > try {
666 > let session: ISerializableChatDataIn;
667 > const log = new ChatSessionOperationLog();
668 > if (fromLocation === logStorageLocation) {
669 session = revive(log.read(rawData));
670 > } else { chatSessionStore.ts
671 session = revive(JSON.parse(rawData.toString()));
672 }
688
689 return { value: normalizeSerializableChatData(session), serializer: log };
690 > } catch (err) { chatSessionStore.ts
691 this.reportError('malformedSession', `Malformed session data in ${fromLocation.fsPath}: [${rawData.slice(0, 20).toString()}${rawData.byteLength > 20 ? '...' : ''}]`, err);
692 return undefined;
693 }
695
696 private async readSessionFromPreviousLocation(sessionId: string): Promise<VSBuffer | undefined> {
src/vs/workbench/test/common/workbenchTestServices.ts 9 introduced LOC · 3 ranges

Open complete file

726
727 override async readFile(resource: URI, options?: IReadFileOptions | undefined): Promise<IFileContent> {
728 > if (this.readShouldThrowError) { workbenchTestServices.ts
729 throw this.readShouldThrowError;
730 }
732 > this.lastReadFileUri = resource;
733 > this.readOperations.push({ resource });
734 >
735 > // Check if we have content in our in-memory store
736 > const content = this.files.get(resource);
737 > if (content) {
738 return {
739 ...createFileStat(resource, this.readonly),
746 value: VSBuffer.fromString(this.content)
747 };
749
750 override async writeFile(resource: URI, bufferOrReadable: VSBuffer | VSBufferReadable, options?: IWriteFileOptions): Promise<IFileStatWithMetadata> {