sshRemoteAgentHostService.ts ×6

Frontier kind: Code frontier

unlabeled · c_149d86fbb6c0

37 tests · 10897 LOC · 48 files · introduces 0 tests · 67 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
6 ranges67 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
1640 ranges10897 lines · 48 files · Browse complete extent
All tests (intent)
37 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: 67 introduced LOC across 6 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/platform/agentHost/node/sshRemoteAgentHostService.ts 67 introduced LOC · 6 ranges

Open complete file

466 }
467
468 > function sanitizeConfig(config: ISSHAgentHostConfig): ISSHAgentHostConfigSanitized { sshRemoteAgentHostService.ts
469 > const { password: _p, privateKeyPath: _k, ...sanitized } = config;
470 > return sanitized;
471 > }
472
473 /**
494
495 constructor(
496 > fullConfig: ISSHAgentHostConfig, sshRemoteAgentHostService.ts
497 > readonly connectionId: string,
498 > readonly address: string,
499 > readonly name: string,
500 > readonly connectionToken: string | undefined,
501 > readonly remotePort: number,
502 > readonly sshClient: SSHClient,
503 > private readonly _relay: { send: (data: string) => void; close: () => void },
504 > private readonly _remoteStream: SSHChannel | undefined,
505 > private readonly _logService: ILogService,
506 > ) {
507 > super();
508 >
509 > this.config = sanitizeConfig(fullConfig);
510 >
511 > // Register cleanup first so it fires _onDidClose *before* the Emitter is disposed.
512 > this._register(toDisposable(() => {
513 > if (this._closed) {
514 return;
515 }
516 > this._closed = true; sshRemoteAgentHostService.ts
517 > this._relay.close();
518 > if (!this._sshClientDetached) {
519 this._remoteStream?.close();
520 sshClient.end();
521 }
522 > this._onDidClose.fire(); sshRemoteAgentHostService.ts
523 > }));
524 >
525 > this._register(this._onDidClose);
526 >
527 > sshClient.on('close', this._sshCloseListener);
528 > sshClient.on('error', this._sshErrorListener);
529 > }
530
531 /**
806 );
807 }
809 > // 7. Create connection object
810 > const address = connectionKey;
811 > conn = new SSHConnection(
812 > config,
813 > connectionId,
814 > address,
815 > config.name,
816 > connectionToken,
817 > remotePort,
818 > sshClient,
819 > relay,
820 > agentStream,
821 > this._logService,
822 > );
823 >
824 > Event.once(conn.onDidClose)(() => {
825 > if (this._connections.get(connectionKey) === conn) {
826 this._connections.deleteAndDispose(connectionKey);
827 this._onDidRelayClose.fire(connectionId);
829 this._onDidChangeConnections.fire();
830 }
832 >
833 > this._connections.set(connectionKey, conn);
834 > sshClient = undefined; // ownership transferred to SSHConnection
835 >
836 > this._onDidChangeConnections.fire();
837 >
838 > return {
839 > connectionId,
840 > address,
841 > name: config.name,
842 > connectionToken,
843 > config: conn.config,
844 > sshConfigHost: config.sshConfigHost,
845 > };
846 >
847 } catch (err) {
848 sshClient?.end();