reducer.ts ×14

Frontier kind: Code frontier

unlabeled · c_cc6242b04e7b

2 tests · 15390 LOC · 93 files · introduces 0 tests · 34 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
15 ranges34 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
1328 ranges15390 lines · 93 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.

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: 34 introduced LOC across 15 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/platform/agentHost/common/state/protocol/channels-terminal/reducer.ts 32 introduced LOC · 14 ranges

Open complete file

16 */
17 export function terminalReducer(state: TerminalState, action: TerminalAction, log?: (msg: string) => void): TerminalState {
18 > switch (action.type) { reducer.ts
19 > case ActionType.TerminalData: {
20 > const content = [...state.content];
21 > const tail = content.length > 0 ? content[content.length - 1] : undefined;
22 > if (tail && tail.type === 'command' && !tail.isComplete) {
23 content[content.length - 1] = { ...tail, output: tail.output + action.data };
24 > } else if (tail && tail.type === 'unclassified') { reducer.ts
25 content[content.length - 1] = { ...tail, value: tail.value + action.data };
26 } else {
27 content.push({ type: 'unclassified', value: action.data });
28 }
29 > return { ...state, content }; reducer.ts
30 > }
31 >
32 > case ActionType.TerminalInput:
33 // Side-effect-only: the server forwards to the pty.
34 // No state change in the reducer.
35 return state;
36 > reducer.ts
37 > case ActionType.TerminalResized:
38 return { ...state, cols: action.cols, rows: action.rows };
39 > reducer.ts
40 > case ActionType.TerminalClaimed:
41 return { ...state, claim: action.claim };
42 > reducer.ts
43 > case ActionType.TerminalTitleChanged:
44 return { ...state, title: action.title };
45 > reducer.ts
46 > case ActionType.TerminalCwdChanged:
47 return { ...state, cwd: action.cwd };
48 > reducer.ts
49 > case ActionType.TerminalExited:
50 return { ...state, exitCode: action.exitCode };
51 > reducer.ts
52 > case ActionType.TerminalCleared:
53 return { ...state, content: [] };
54 > reducer.ts
55 > case ActionType.TerminalCommandDetectionAvailable:
56 return { ...state, supportsCommandDetection: true };
57 > reducer.ts
58 > case ActionType.TerminalCommandExecuted: {
59 const part: TerminalContentPart = {
60 type: 'command',
71 };
72 }
73 > reducer.ts
74 > case ActionType.TerminalCommandFinished: {
75 const content = state.content.map(p => {
76 if (p.type === 'command' && p.commandId === action.commandId) {
86 return { ...state, content };
87 }
88 > reducer.ts
89 > default:
90 softAssertNever(action, log);
91 return state;
92 > } reducer.ts
93 > }
src/vs/platform/agentHost/common/state/agentSubscription.ts 2 introduced LOC · 1 range

Open complete file

561
562 protected override _applyReducer(state: TerminalState, action: StateAction): TerminalState {
563 > return terminalReducer(state, action as TerminalAction, this._log); agentSubscription.ts
564 > }
565
566 protected override _isRelevantEnvelope(envelope: ActionEnvelope): boolean {