chatServiceImpl.ts ×4

Frontier kind: Joint frontier

unlabeled · c_d80e0570dbd8

2 tests · 71326 LOC · 309 files · introduces 1 test · 43 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
6 ranges43 lines · 2 files
Tests
1 test

Contains — complete concept membership

All code (extent)
6006 ranges71326 lines · 309 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: 43 introduced LOC across 6 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.ts 38 introduced LOC · 4 ranges

Open complete file

2189
2190 syncPendingRequestsFromRemote(sessionResource: URI, requests: readonly IRemotePendingRequest[]): void {
2191 > const model = this._sessionModels.get(sessionResource) as ChatModel | undefined; chatServiceImpl.ts
2192 > if (!model) {
2193 return;
2194 }
2196 > const existing = model.getPendingRequests();
2197 > const existingById = new Map(existing.map(request => [request.request.id, request]));
2198 > const reconciled: IChatPendingRequest[] = requests.map(remote => {
2199 > const variableData = remote.variableData ?? { variables: [] };
2200 > const local = existingById.get(remote.id);
2201 > if (local && local.request.message.text === remote.message && equals(local.request.variableData, variableData)) {
2202 > return local.kind === remote.kind ? local : { ...local, kind: remote.kind };
2203 > }
2204 > const parsedRequest = this.parseChatRequest(sessionResource, remote.message, model.initialLocation, undefined);
2205 > const requestModel = new ChatRequestModel({
2206 > session: model,
2207 > message: parsedRequest,
2208 > variableData,
2209 > timestamp: remote.timestamp,
2210 > attachedContext: variableData.variables.slice(),
2211 > restoredId: remote.id,
2212 > });
2213 > return { request: requestModel, kind: remote.kind, sendOptions: local?.sendOptions ?? {} };
2214 > });
2215 >
2216 > if (existing.length === reconciled.length && reconciled.every((request, index) => existing[index] === request)) {
2217 return;
2218 }
2220 > const reconciledIds = new Set(reconciled.map(request => request.request.id));
2221 > model.replacePendingRequests(reconciled);
2222 >
2223 > for (const local of existing) {
2224 > if (reconciledIds.has(local.request.id)) {
2225 > continue;
2226 > }
2227 const deferred = this._queuedRequestDeferreds.get(local.request.id);
2228 if (deferred) {
2230 this._queuedRequestDeferreds.delete(local.request.id);
2231 }
2233 >
2234 > if (!reconciled.some(request => request.kind === ChatRequestQueueKind.Steering)) {
2235 > this._pendingRequests.get(sessionResource)?.resetYieldRequested();
2236 > }
2237 > }
2238
2239 async sendPendingRequestImmediately(sessionResource: URI, requestId: string): Promise<void> {
src/vs/workbench/contrib/chat/common/model/chatModel.ts 5 introduced LOC · 2 ranges

Open complete file

2331 */
2332 replacePendingRequests(requests: readonly IChatPendingRequest[]): void {
2333 > if (this._pendingRequests.length === requests.length && requests.every((request, index) => this._pendingRequests[index] === request)) { chatModel.ts
2334 return;
2335 }
2336 > this._pendingRequests.length = 0; chatModel.ts
2337 > this._pendingRequests.push(...requests);
2338 > this._onDidChangePendingRequests.fire();
2339 > }
2340
2341 /**