agentHostChangesetOperationService.ts ×4

Frontier kind: Joint frontier

unlabeled · c_e052f0b7cd9c

1 test · 52112 LOC · 304 files · introduces 1 test · 49 LOC · 5 files

Introduces — evidence that enters the hierarchy at this concept

Code
10 ranges49 lines · 5 files
Tests
1 test

Contains — complete concept membership

All code (extent)
5584 ranges52112 lines · 304 files · Browse complete extent
All tests (intent)
1 testBrowse 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.

5 files ranked by introduced lines: 49 introduced LOC across 10 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/platform/agentHost/node/agentHostChangesetOperationService.ts 29 introduced LOC · 4 ranges

Open complete file

58 }
59 }
61 > if (!gitHubState) {
62 > gitHubState = readSessionGitHubState(this._stateManager.getSessionState(sessionKey)?._meta);
63 > }
64 >
65 > const parsed = parseChangesetUri(changeset);
66 > if (!parsed) {
67 return [];
68 }
70 > return this._getOperations({
71 > sessionKey,
72 > changesetUri: changeset,
73 > changesetKind: parsed.kind,
74 > gitState,
75 > gitHubState
76 > });
77 }
78
79 private _getOperations(context: IChangesetOperationContext): readonly ChangesetOperation[] {
80 > const operations: ChangesetOperation[] = []; agentHostChangesetOperationService.ts
81 > for (const contribution of this._handlerRegistrations.keys()) {
82 > const contributed = contribution.getOperations(context);
83 > if (contributed) {
84 > operations.push(...contributed);
85 > }
86 > }
87 >
88 > // Operations are disabled while a turn is active so the working tree /
89 > // branch state can't be mutated mid-request.
90 > if (this._stateManager.hasActiveTurn(context.sessionKey)) {
91 return operations.map(operation => ({
92 ...operation,
94 }));
95 }
97 > return operations;
98 > }
99
100 updateOperations(sessionKey: string, changeset?: string, gitState?: ISessionGitState, gitHubState?: ISessionGitHubState): void {
src/vs/platform/agentHost/node/agentHostDiscardChangesOperationProvider.ts 11 introduced LOC · 2 ranges

Open complete file

32
33 getOperations({ changesetKind, gitState }: IChangesetOperationContext): ChangesetOperation[] {
34 > if (changesetKind !== ChangesetKind.Uncommitted || (gitState?.uncommittedChanges ?? 0) <= 0) { agentHostDiscardChangesOperationProvider.ts
35 return [];
36 }
38 > return [{
39 > id: AgentHostDiscardChangesOperationHandler.OPERATION_DISCARD_CHANGES,
40 > label: localize('agentHost.changeset.discardChanges', "Discard Changes"),
41 > confirmation: localize('agentHost.changeset.discardChanges.confirmation', "Are you sure you want to discard the changes in \'{0}\'? This action cannot be undone."),
42 > icon: 'discard',
43 > scopes: [ChangesetOperationScope.Resource],
44 > status: ChangesetOperationStatus.Idle,
45 > } satisfies ChangesetOperation];
46 > }
47 }
src/vs/platform/agentHost/node/agentHostChangesetService.ts 5 introduced LOC · 2 ranges

Open complete file

554 return uncommittedUri;
555 }
557 > this._publishChangesetDiffs(session, uncommittedUri, diffs);
558 > } catch (err) {
559 this._logService.warn(`[AgentHostChangesetService] Failed to compute uncommitted diffs for ${session}`, err);
560 this._stateManager.dispatchServerAction(uncommittedUri, {
src/vs/platform/agentHost/node/agentHostPullRequestOperationProvider.ts 2 introduced LOC · 1 range

Open complete file

48 const state = this._stateManager.getSessionState(sessionKey);
49 if (state?.lifecycle === SessionLifecycle.Creating) {
51 > }
52
53 // Pull request already exists
src/vs/platform/agentHost/node/agentHostSyncOperationProvider.ts 2 introduced LOC · 1 range

Open complete file

37 const state = this._stateManager.getSessionState(sessionKey);
38 if (state?.lifecycle === SessionLifecycle.Creating && (gitState?.uncommittedChanges ?? 0) > 0) {
39 > return undefined; agentHostSyncOperationProvider.ts
40 > }
41
42 // No upstream branch or no outgoing changes