(
delegate: IBinderDelegate,
connection: DapConnection,
private readonly _rootServices: Container,
targetOrigin: ITargetOrigin,
)
| 60 | private _launchers?: ReadonlySet<ILauncher>; |
| 61 | |
| 62 | constructor( |
| 63 | delegate: IBinderDelegate, |
| 64 | connection: DapConnection, |
| 65 | private readonly _rootServices: Container, |
| 66 | targetOrigin: ITargetOrigin, |
| 67 | ) { |
| 68 | this._delegate = delegate; |
| 69 | this._dap = connection.dap(); |
| 70 | this._targetOrigin = targetOrigin; |
| 71 | this._disposables = [ |
| 72 | this._onTargetListChangedEmitter, |
| 73 | installUnhandledErrorReporter( |
| 74 | _rootServices.get(ILogger), |
| 75 | _rootServices.get(ITelemetryReporter), |
| 76 | ), |
| 77 | ]; |
| 78 | |
| 79 | connection.attachTelemetry(_rootServices.get(ITelemetryReporter)); |
| 80 | |
| 81 | this._dap.then(dap => { |
| 82 | let lastBreakpointId = 0; |
| 83 | let selfProfile: SelfProfile | undefined; |
| 84 | |
| 85 | dap.on('initialize', async clientCapabilities => { |
| 86 | this._rootServices.bind(IInitializeParams).toConstantValue(clientCapabilities); |
| 87 | const capabilities = DebugAdapter.capabilities(); |
| 88 | if (clientCapabilities.clientID === 'vscode') { |
| 89 | filterErrorsReportedToTelemetry(); |
| 90 | } |
| 91 | |
| 92 | setTimeout(() => { |
| 93 | dap.initialized({}); |
| 94 | }, 0); |
| 95 | return capabilities; |
| 96 | }); |
| 97 | dap.on('setExceptionBreakpoints', async () => ({})); |
| 98 | dap.on('setBreakpoints', async params => { |
| 99 | return { |
| 100 | breakpoints: |
| 101 | params.breakpoints?.map(() => ({ |
| 102 | id: ++lastBreakpointId, |
| 103 | verified: false, |
| 104 | message: localize('breakpoint.provisionalBreakpoint', `Unbound breakpoint`), |
| 105 | })) ?? [], |
| 106 | }; // TODO: Put a useful message here |
| 107 | }); |
| 108 | dap.on('configurationDone', async () => ({})); |
| 109 | dap.on('threads', async () => ({ threads: [] })); |
| 110 | dap.on('loadedSources', async () => ({ sources: [] })); |
| 111 | dap.on('breakpointLocations', () => Promise.resolve({ breakpoints: [] })); |
| 112 | dap.on('attach', params => |
| 113 | this._boot(applyDefaults(params as AnyResolvingConfiguration), dap), |
| 114 | ); |
| 115 | dap.on('launch', params => |
| 116 | this._boot(applyDefaults(params as AnyResolvingConfiguration), dap), |
| 117 | ); |
| 118 | dap.on('terminate', async () => { |
| 119 | await this._disconnect(); |
nothing calls this directly
no test coverage detected