protocolServerHandler.ts ×6

Frontier kind: Code frontier

unlabeled · c_7dd7df7639f9

76 tests · 28307 LOC · 148 files · introduces 0 tests · 23 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
7 ranges23 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
2642 ranges28307 lines · 148 files · Browse complete extent
All tests (intent)
76 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: 23 introduced LOC across 7 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/platform/agentHost/node/protocolServerHandler.ts 21 introduced LOC · 6 ranges

Open complete file

353
354 this._register(this._server.onConnection(transport => {
355 > this._handleNewConnection(transport); protocolServerHandler.ts
356 }));
357
394
395 private _handleNewConnection(transport: IProtocolTransport): void {
396 > const disposables = new DisposableStore(); protocolServerHandler.ts
397 > let client: IConnectedClient | undefined;
398 >
399 > disposables.add(transport.onMessage(msg => {
400 > if (isJsonRpcRequest(msg)) {
401 > this._logService.trace(`[ProtocolServer] request: method=${msg.method} id=${msg.id}`);
402 >
403 > // Ping is stateless and MUST be answerable regardless of whether
404 > // the connection has been initialized. Carries no payload — the
405 > // round-trip itself is the liveness signal.
406 > if (msg.method === 'ping') {
407 transport.send(jsonRpcSuccess(msg.id, null));
408 return;
410
411 // Handle initialize/reconnect as requests that set up the client
412 > if (!client && msg.method === 'initialize') { protocolServerHandler.ts
413 try {
414 const result = this._handleInitialize(msg.params, transport, disposables);
420 return;
421 }
422 > if (!client && msg.method === 'reconnect') { protocolServerHandler.ts
423 let responsePromise: Promise<unknown>;
424 try {
501 }
502 }
504 >
505 > disposables.add(transport.onClose(() => {
506 const record = client ? this._clients.get(client.clientId) : undefined;
507 if (client && record?.state === 'active') {
521 }
522 disposables.dispose();
524 >
525 > disposables.add(transport);
526 > }
527
528 // ---- Handshake handlers ----------------------------------------------------
src/vs/platform/agentHost/common/state/sessionProtocol.ts 2 introduced LOC · 1 range

Open complete file

109
110 export function isJsonRpcRequest(msg: ProtocolMessage): msg is AhpRequest {
111 > return 'method' in msg && 'id' in msg; sessionProtocol.ts
112 > }
113
114 export function isJsonRpcNotification(msg: ProtocolMessage): msg is AhpNotification {