testAgentHostTerminalManager.ts ×4

Frontier kind: Code frontier

unlabeled · c_ea20452a6a55

398 tests · 34961 LOC · 193 files · introduces 0 tests · 44 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
4 ranges44 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
2882 ranges34961 lines · 193 files · Browse complete extent
All tests (intent)
398 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: 44 introduced LOC across 4 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/platform/agentHost/test/node/testAgentHostTerminalManager.ts 44 introduced LOC · 4 ranges

Open complete file

1 > /*--------------------------------------------------------------------------------------------- testAgentHostTerminalManager.ts
2 > * Copyright (c) Microsoft Corporation. All rights reserved.
3 > * Licensed under the MIT License. See License.txt in the project root for license information.
4 > *--------------------------------------------------------------------------------------------*/
5 >
6 > import { DeferredPromise } from '../../../../base/common/async.js';
7 > import { Emitter } from '../../../../base/common/event.js';
8 > import { Disposable, IDisposable } from '../../../../base/common/lifecycle.js';
9 > import type { CreateTerminalParams } from '../../common/state/protocol/commands.js';
10 > import type { TerminalClaim, TerminalInfo, TerminalState } from '../../common/state/protocol/state.js';
11 > import type { IAgentHostTerminalManager, ICommandFinishedEvent } from '../../node/agentHostTerminalManager.js';
12 >
13 > /**
14 > * Controllable fake {@link IAgentHostTerminalManager} for tests. `createTerminal`
15 > * records the request and announces the terminal URI via
16 > * {@link onDidCreateTerminal}; tests drive command completion with
17 > * {@link fireCommandFinished}. When no terminal interaction is needed it also
18 > * serves as a benign no-op stand-in.
19 > */
20 > export class TestAgentHostTerminalManager extends Disposable implements IAgentHostTerminalManager {
21 declare readonly _serviceBrand: undefined;
22
40 private readonly _onDidCreateTerminal = this._register(new Emitter<string>());
41 readonly onDidCreateTerminal = this._onDidCreateTerminal.event;
43 > async createTerminal(params: CreateTerminalParams): Promise<void> {
44 this.created.push(params);
45 this._onDidCreateTerminal.fire(params.channel);
46 }
47 > writeInput(): void { } testAgentHostTerminalManager.ts
48 > async sendText(uri: string, data: string): Promise<void> { this.sentTexts.push({ uri, data }); }
49 > onData(_uri: string, cb: (data: string) => void): IDisposable { return this._onData.event(cb); }
50 > onExit(_uri: string, cb: (exitCode: number) => void): IDisposable { return this._onExit.event(cb); }
51 > onClaimChanged(_uri: string, cb: (claim: TerminalClaim) => void): IDisposable { return this._onClaimChanged.event(cb); }
52 > onCommandFinished(_uri: string, cb: (event: ICommandFinishedEvent) => void): IDisposable {
53 this.commandFinishedListenerRegistered.complete();
54 return this._onCommandFinished.event(cb);
55 }
56 > createAltBufferPromise(): Promise<void> { return new Promise<void>(() => { }); } testAgentHostTerminalManager.ts
57 > getContent(): string | undefined { return undefined; }
58 > getClaim(): TerminalClaim | undefined { return undefined; }
59 > hasTerminal(): boolean { return false; }
60 > getExitCode(): number | undefined { return undefined; }
61 > supportsCommandDetection(): boolean { return this.commandDetectionSupported; }
62 > disposeTerminal(uri: string): void { this.disposedTerminals.push(uri); }
63 > getTerminalInfos(): TerminalInfo[] { return []; }
64 > getTerminalState(): TerminalState | undefined { return undefined; }
65 > async getDefaultShell(): Promise<string> { return this.defaultShell; }
66 > createOutputTerminal(uri: string, options: { title: string; claim: TerminalClaim }): void { this.outputTerminalsCreated.push({ uri, title: options.title, claim: options.claim }); }
67 > appendOutputTerminalData(uri: string, data: string): void { this.outputTerminalData.push({ uri, data }); }
68 > resetOutputTerminal(uri: string): void { this.outputTerminalResets.push(uri); }
69 > finalizeOutputTerminal(uri: string, exitCode: number | undefined): void { this.outputTerminalsFinalized.push({ uri, exitCode }); }
70 > fireCommandFinished(event: ICommandFinishedEvent): void { this._onCommandFinished.fire(event); }
71 > }