mockChatService.ts ×25

Frontier kind: Code frontier

unlabeled · c_3ea6a13ebfaf

140 tests · 40383 LOC · 178 files · introduces 0 tests · 97 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
25 ranges97 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
3702 ranges40383 lines · 178 files · Browse complete extent
All tests (intent)
140 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: 97 introduced LOC across 25 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/workbench/contrib/chat/test/common/chatService/mockChatService.ts 97 introduced LOC · 25 ranges

Open complete file

15
16 export class MockChatService implements IChatService {
17 > private readonly _chatModels: ISettableObservable<Iterable<IChatModel>> = observableValue('chatModels', []); mockChatService.ts
18 > readonly chatModels = this._chatModels;
19 > requestInProgressObs = observableValue('name', false);
20 > _serviceBrand: undefined;
21 > editingSessions = [];
22 > transferredSessionResource = undefined;
23 > readonly onDidSubmitRequest = Event.None;
24 >
25 > private readonly _onDidCreateModel = new Emitter<IChatModel>();
26 > readonly onDidCreateModel = this._onDidCreateModel.event;
27 >
28 > private readonly sessions = new ResourceMap<IChatModel>();
29 > private liveSessionItems: IChatDetail[] = [];
30 > private historySessionItems: IChatDetail[] = [];
31 >
32 > private readonly _onDidDisposeSession = new Emitter<{ sessionResources: URI[]; reason: 'cleared' }>();
33 > readonly onDidDisposeSession = this._onDidDisposeSession.event;
34 >
35 > fireDidDisposeSession(sessionResources: URI[]): void {
36 > this._onDidDisposeSession.fire({ sessionResources, reason: 'cleared' });
37 > }
38 >
39 > setSaveModelsEnabled(enabled: boolean): void {
40
41 }
43 > processPendingRequests(sessionResource: URI): void {
44
45 }
47 > setLiveSessionItems(items: IChatDetail[]): void {
48 this.liveSessionItems = items;
49 }
51 > setHistorySessionItems(items: IChatDetail[]): void {
52 this.historySessionItems = items;
53 }
55 > addSession(session: IChatModel): void {
56 this.sessions.set(session.sessionResource, session);
57 // Update the chatModels observable
59 this._onDidCreateModel.fire(session);
60 }
62 > removeSession(sessionResource: URI): void {
63 this.sessions.delete(sessionResource);
64 // Update the chatModels observable
65 this._chatModels.set([...this.sessions.values()], undefined);
66 }
68 > isEnabled(_location: ChatAgentLocation): boolean {
69 return true;
70 }
72 > hasSessions(): boolean {
73 return this.sessions.size > 0;
74 }
76 > getProviderInfos() {
77 return [];
78 }
80 > startNewLocalSession(_location: ChatAgentLocation, _options?: IChatSessionStartOptions): IChatModelReference {
81 throw new Error('Method not implemented.');
82 }
84 > getSession(sessionResource: URI): IChatModel | undefined {
85 return this.sessions.get(sessionResource);
86 }
88 > getLatestRequest(): IChatRequestModel | undefined {
89 return undefined;
90 }
92 > acquireOrRestoreSession(_sessionResource: URI): Promise<IChatModelReference | undefined> {
93 throw new Error('Method not implemented.');
94 }
96 > getSessionTitle(_sessionResource: URI): string | undefined {
97 return undefined;
98 }
100 > loadSessionFromData(data: IExportableChatData | ISerializableChatData, _debugOwner?: string): IChatModelReference {
101 throw new Error('Method not implemented.');
102 }
104 > getChatModelReferenceDebugInfo(): IChatModelReferenceDebugSnapshot {
105 return { totalModels: 0, totalReferences: 0, models: [] };
106 }
108 > acquireOrLoadSession(_resource: URI, _position: ChatAgentLocation, _token: CancellationToken, _debugOwner?: string): Promise<IChatModelReference | undefined> {
109 throw new Error('Method not implemented.');
110 }
112 > acquireExistingSession(_sessionResource: URI, _debugOwner?: string): IChatModelReference | undefined {
113 return undefined;
114 }
116 > setSessionTitle(_sessionResource: URI, _title: string): void { }
117 >
118 > appendProgress(_request: IChatRequestModel, _progress: IChatProgress): void { }
119 >
120 > sendRequest(_sessionResource: URI, _message: string): Promise<ChatSendResult> {
121 throw new Error('Method not implemented.');
122 }
124 > resendRequest(_request: IChatRequestModel, _options?: IChatSendRequestOptions): Promise<void> {
125 throw new Error('Method not implemented.');
126 }
128 > adoptRequest(_sessionResource: URI, _request: IChatRequestModel): Promise<void> {
129 throw new Error('Method not implemented.');
130 }
132 > removeRequest(_sessionResource: URI, _requestId: string): Promise<void> {
133 throw new Error('Method not implemented.');
134 }
136 > async cancelCurrentRequestForSession(_sessionResource: URI, _source?: string): Promise<void> { }
137 >
138 > migrateRequests(_originalResource: URI, _targetResource: URI): void { }
139 >
140 > setYieldRequested(_sessionResource: URI): void { }
141 >
142 > removePendingRequest(_sessionResource: URI, _requestId: string): void { }
143 >
144 > setPendingRequests(_sessionResource: URI, _requests: readonly { requestId: string; kind: ChatRequestQueueKind }[]): void { }
145 >
146 > syncPendingRequestsFromRemote(_sessionResource: URI, _requests: readonly IRemotePendingRequest[]): void { }
147 >
148 > sendPendingRequestImmediately(_sessionResource: URI, _requestId: string): Promise<void> {
149 throw new Error('Method not implemented.');
150 }
152 > addCompleteRequest(): void { }
153 >
154 > async getLocalSessionHistory(): Promise<IChatDetail[]> {
155 return this.historySessionItems;
156 }
158 > async clearAllHistoryEntries(): Promise<void> { }
159 >
160 > async removeHistoryEntry(_resource: URI): Promise<void> { }
161 >
162 > readonly onDidPerformUserAction = Event.None;
163 >
164 > notifyUserAction(_event: IChatUserActionEvent): void { }
165 >
166 > readonly onDidReceiveQuestionCarouselAnswer = Event.None;
167
168 notifyQuestionCarouselAnswer(_requestId: string, _resolveId: string, _answers: Record<string, unknown> | undefined): void { }