(
launchParams: Dap.LaunchParams | Dap.AttachParams,
)
| 100 | |
| 101 | return new Promise<IInitializationCollection>(resolve => { |
| 102 | const handle = async ( |
| 103 | launchParams: Dap.LaunchParams | Dap.AttachParams, |
| 104 | ): Promise<Dap.LaunchResult | Dap.AttachResult> => { |
| 105 | // By spec, clients should not call launch until after ConfigurationDone... |
| 106 | // but VS Code doesn't actually do this, and breakpoints aren't sent |
| 107 | // until ConfigurationDone happens, so make sure to wait on it. |
| 108 | await configurationDone.promise; |
| 109 | |
| 110 | const deferred = getDeferred<Dap.LaunchResult | Dap.AttachResult>(); |
| 111 | if (!initializeParams) { |
| 112 | throw new Error(`cannot call launch/attach before initialize`); |
| 113 | } |
| 114 | |
| 115 | resolve({ |
| 116 | initializeParams, |
| 117 | setExceptionBreakpointsParams, |
| 118 | setBreakpointsParams, |
| 119 | customBreakpoints, |
| 120 | xhrBreakpoints, |
| 121 | launchParams: launchParams as AnyResolvingConfiguration, |
| 122 | deferred, |
| 123 | }); |
| 124 | |
| 125 | return deferred.promise; |
| 126 | }; |
| 127 | dap.on('launch', p => handle(p)); |
| 128 | dap.on('attach', handle); |
| 129 | }); |
no test coverage detected