* @inheritdoc
(
debugSession: TSessionImpl,
pendingTargetId: string,
transport: IDapTransport | DapConnection,
)
| 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 |
no test coverage detected