MCPcopy
hub / github.com/microsoft/vscode-js-debug / createNewChildSession

Method createNewChildSession

src/sessionManager.ts:171–198  ·  view source on GitHub ↗

* @inheritdoc

(
    debugSession: TSessionImpl,
    pendingTargetId: string,
    transport: IDapTransport | DapConnection,
  )

Source from the content-addressed store, hash-verified

169 * @inheritdoc
170 */
171 public createNewChildSession(
172 debugSession: TSessionImpl,
173 pendingTargetId: string,
174 transport: IDapTransport | DapConnection,
175 ): Session<TSessionImpl> {
176 const pending = this._pendingTarget.get(pendingTargetId);
177 if (!pending) {
178 throw new Error(`Cannot find target ${pendingTargetId}`);
179 }
180
181 const { target, parent } = pending;
182 const session = new Session<TSessionImpl>(
183 debugSession,
184 transport,
185 parent.logger,
186 parent.sessionStates,
187 parent,
188 );
189
190 this._pendingTarget.delete(pendingTargetId);
191 session.debugSession.name = target.name();
192 session.listenToTarget(target);
193 const callbacks = this._sessionForTargetCallbacks.get(target);
194 this._sessionForTargetCallbacks.delete(target);
195 callbacks?.fulfill?.(session);
196 this._sessions.set(debugSession.id, session);
197 return session;
198 }
199
200 /**
201 * @inheritdoc

Callers 2

createSessionMethod · 0.80

Calls 5

listenToTargetMethod · 0.95
getMethod · 0.65
deleteMethod · 0.65
nameMethod · 0.65
setMethod · 0.65

Tested by

no test coverage detected