agentHostChangesetService.ts ×9

Frontier kind: Code frontier

unlabeled · c_31c6abf00fe2

3 tests · 51618 LOC · 304 files · introduces 0 tests · 30 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
9 ranges30 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
5446 ranges51618 lines · 304 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.

1 file ranked by introduced lines: 30 introduced LOC across 9 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

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

Open complete file

177 */
178 private _hasSubscription(session: ProtocolURI, changeset: ProtocolURI): boolean {
179 > return this._changesetSubscriptions.getSessionSubscriptions(session).has(changeset); agentHostChangesetService.ts
180 > }
181
182 private _hasWorkingDirectory(session: ProtocolURI): boolean {
518
519 async computeUncommittedChangeset(session: ProtocolURI): Promise<ProtocolURI> {
520 > const uncommittedUri = this._stateManager.registerChangeset(buildUncommittedChangesetUri(session)); agentHostChangesetService.ts
521 > if (!this._hasSubscription(session, uncommittedUri)) {
522 return uncommittedUri;
523 }
525 > // Defer until the working directory is known. Computing now would bail
526 > // in the git path (there is no SDK edit-tracker fallback for the
527 > // uncommitted slot); `onWorkingDirectoryAvailable` re-runs the refresh
528 > // once materialization / restore populates the directory.
529 > if (!this._hasWorkingDirectory(session)) {
530 this._pendingMaterialization.add(session);
531 return uncommittedUri;
532 }
534 > const statusBeforeCompute = this._stateManager.getChangesetState(uncommittedUri)?.status;
535 > if (statusBeforeCompute !== ChangesetStatus.Computing) {
536 this._stateManager.dispatchServerAction(uncommittedUri, {
537 type: ActionType.ChangesetStatusChanged,
539 });
540 }
542 > try {
543 > const diffs = await this._computeUncommittedDiffs(session);
544 > if (diffs === undefined) {
545 // Git unavailable (no working directory, not a git work
546 // tree, or the git command returned nothing). Surface as
566
567 return uncommittedUri;
569
570 private async _computeUncommittedDiffs(session: ProtocolURI): Promise<readonly ISessionFileDiff[] | undefined> {
571 > const workingDirectory = this._stateManager.getSessionState(session)?.workingDirectories?.[0]; agentHostChangesetService.ts
572 > if (!workingDirectory) {
573 return undefined;
574 }
576 > let workingDirectoryUri: URI;
577 > try {
578 > workingDirectoryUri = URI.parse(workingDirectory);
579 > } catch {
580 return undefined;
581 }
583 > return this._gitService.computeSessionFileDiffs(workingDirectoryUri, {
584 > sessionUri: session,
585 > });
586 > }
587
588 private async _computeTurnDiffsPreferCheckpoint(session: ProtocolURI, db: ISessionDatabase, turnId: string): Promise<readonly ISessionFileDiff[]> {