agentHostChangesetService.ts ×6

Frontier kind: Code frontier

unlabeled · c_690d8be5fc9f

3 tests · 50167 LOC · 290 files · introduces 0 tests · 31 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
7 ranges31 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
5168 ranges50167 lines · 290 files · Browse complete extent
All tests (intent)
3 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: 31 introduced LOC across 7 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/platform/agentHost/node/agentHostChangesetService.ts 30 introduced LOC · 6 ranges

Open complete file

62 * input so callers can distinguish "no data yet" from "data, zero changes".
63 */
64 > function summariseDiffs(diffs: readonly ISessionFileDiff[] | undefined): ChangesSummary | undefined { agentHostChangesetService.ts
65 > if (!diffs) {
66 > return undefined;
67 > }
68 let additions = 0;
69 let deletions = 0;
93 * is seeded once at session creation.
94 */
95 > function computeChangesSummaryFromLiveState( agentHostChangesetService.ts
96 > session: ChangesetState | undefined,
97 > ): ChangesSummary | undefined {
98 > const sessionDiffs = session?.status === ChangesetStatus.Ready ? session.files.map(f => f.edit) : undefined;
99 > return summariseDiffs(sessionDiffs);
100 > }
101
102 /**
248 return undefined;
249 }
251 > // Check if the metadata contains the changes summary. In the past we
252 > // used to store the changesets in the session database but we have
253 > // since moved to a more efficient storage mechanism by only storing
254 > // the changes summary.
255 > const changesSummary = metadata[META_CHANGES_SUMMARY];
256 > if (changesSummary !== undefined) {
257 try {
258 return JSON.parse(changesSummary) as ChangesSummary;
261 }
262 }
264 > // Read live state for an unopened session: synthesise the aggregate
265 > // from the live `changeKind: 'branch'` changeset state. Counts stay
266 > // in lockstep with the actual changeset state for the session-list chip.
267 > const liveSession = this._stateManager.getChangesetState(buildBranchChangesetUri(sessionUri));
268 > const liveChanges = computeChangesSummaryFromLiveState(liveSession);
269 > if (liveChanges) {
270 // Migrate the changes summary to the new storage mechanism.
271 this.persistChangesSummary(sessionUri, liveChanges);
272 return liveChanges;
273 }
275 > // No live source — try persisted blobs (if the caller batched them).
276 > const branchRaw = metadata[META_CHANGESET_BRANCH];
277 > const legacyRaw = metadata[META_LEGACY_DIFFS];
278 if (branchRaw === undefined && legacyRaw === undefined) {
279 > return undefined; agentHostChangesetService.ts
280 > }
281 const restored = this.parsePersistedStaticChangesets(sessionUri, { branchRaw, legacyRaw });
282
src/vs/platform/agentHost/node/agentService.ts 1 introduced LOC · 1 range

Open complete file