mockChatModel.ts ×6

Frontier kind: Code frontier

unlabeled · c_8f8353143795

36 tests · 22583 LOC · 120 files · introduces 0 tests · 68 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
6 ranges68 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
2508 ranges22583 lines · 120 files · Browse complete extent
All tests (intent)
36 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: 68 introduced LOC across 6 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/workbench/contrib/chat/test/common/model/mockChatModel.ts 68 introduced LOC · 6 ranges

Open complete file

1 > /*--------------------------------------------------------------------------------------------- mockChatModel.ts
2 > * Copyright (c) Microsoft Corporation. All rights reserved.
3 > * Licensed under the MIT License. See License.txt in the project root for license information.
4 > *--------------------------------------------------------------------------------------------*/
5 >
6 > import { Emitter, Event } from '../../../../../../base/common/event.js';
7 > import { Disposable } from '../../../../../../base/common/lifecycle.js';
8 > import { IObservable, observableValue } from '../../../../../../base/common/observable.js';
9 > import { URI } from '../../../../../../base/common/uri.js';
10 > import { IChatEditingSession } from '../../../common/editing/chatEditingService.js';
11 > import { IChatChangeEvent, IChatModel, IChatPendingRequest, IChatRequestModel, IChatRequestNeedsInputInfo, IExportableChatData, IExportableRepoData, IInputModel, ISerializableChatData } from '../../../common/model/chatModel.js';
12 > import { ChatAgentLocation } from '../../../common/constants.js';
13 > import { IChatSessionContext, IChatSessionTiming } from '../../../common/chatService/chatService.js';
14 >
15 > export class MockChatModel extends Disposable implements IChatModel {
16 > readonly onDidDispose = this._register(new Emitter<void>()).event;
17 > readonly onDidChange = this._register(new Emitter<IChatChangeEvent>()).event;
18 > sessionId = '';
19 > readonly timestamp = 0;
20 > readonly timing: IChatSessionTiming = { created: Date.now(), lastRequestStarted: undefined, lastRequestEnded: undefined };
21 > readonly initialLocation = ChatAgentLocation.Chat;
22 > readonly title = '';
23 > readonly hasCustomTitle = false;
24 > customTitle: string | undefined;
25 > lastMessageDate = Date.now();
26 > creationDate = Date.now();
27 > requests: IChatRequestModel[] = [];
28 > readonly requestInProgress = observableValue('requestInProgress', false);
29 > readonly hasActiveRequest = observableValue('hasActiveRequest', false);
30 > readonly requestNeedsInput = observableValue<IChatRequestNeedsInputInfo | undefined>('requestNeedsInput', undefined);
31 > readonly isReadOnly = observableValue(this, false);
32 > readonly inputPlaceholder = undefined;
33 > readonly editingSession = undefined;
34 > readonly checkpoint = undefined;
35 > readonly willKeepAlive = true;
36 > readonly responderUsername: string = 'agent';
37 > readonly inputModel: IInputModel = {
38 > state: observableValue('inputModelState', undefined),
39 > setState: () => { },
40 > clearState: () => { },
41 > toJSON: () => undefined
42 > };
43 > readonly contributedChatSession = undefined;
44 > repoData: IExportableRepoData | undefined = undefined;
45 > isDisposed = false;
46 > lastRequestObs: IObservable<IChatRequestModel | undefined>;
47 >
48 > constructor(readonly sessionResource: URI) {
49 super();
50 this.lastRequest = undefined;
51 this.lastRequestObs = observableValue('lastRequest', undefined);
52 }
54 > setContributedChatSession(session: IChatSessionContext | undefined): void {
55 throw new Error('Method not implemented.');
56 }
58 > readonly hasRequests = false;
59 > readonly lastRequest: IChatRequestModel | undefined;
60 > readonly sessionCost: number = 0;
61 >
62 > override dispose() {
63 this.isDisposed = true;
64 super.dispose();
65 }
67 > startEditingSession(isGlobalEditingSession?: boolean, transferFromSession?: IChatEditingSession): void { }
68 > getRequests(): IChatRequestModel[] { return []; }
69 > setCheckpoint(requestId: string | undefined): void { }
70 > setRepoData(data: IExportableRepoData | undefined): void { this.repoData = data; }
71 > workingDirectory: URI | undefined = undefined;
72 > setWorkingDirectory(uri: URI | undefined): void { this.workingDirectory = uri; }
73 > readonly onDidChangePendingRequests: Event<void> = this._register(new Emitter<void>()).event;
74 > getPendingRequests(): readonly IChatPendingRequest[] { return []; }
75 > toExport(): IExportableChatData {
76 return {
77 initialLocation: this.initialLocation,
80 };
81 }
82 > toJSON(): ISerializableChatData { mockChatModel.ts
83 return {
84 version: 3,