( parent: Container, target: ITarget, dap: Dap.Api, cdp: Cdp.Api, )
| 104 | * Gets the container for a single target within a session. |
| 105 | */ |
| 106 | export const createTargetContainer = ( |
| 107 | parent: Container, |
| 108 | target: ITarget, |
| 109 | dap: Dap.Api, |
| 110 | cdp: Cdp.Api, |
| 111 | ) => { |
| 112 | const container = new Container(); |
| 113 | container.parent = parent; |
| 114 | container.bind(IContainer).toConstantValue(container); |
| 115 | container.bind(IDapApi).toConstantValue(dap); |
| 116 | container.bind(ICdpApi).toConstantValue(cdp); |
| 117 | container.bind(ITarget).toConstantValue(target); |
| 118 | container.bind(ITargetOrigin).toConstantValue(target.targetOrigin()); |
| 119 | container.bind(ISourcePathResolver).toConstantValue(target.sourcePathResolver()); |
| 120 | container.bind(IResourceProvider).to(StatefulResourceProvider).inSingletonScope(); |
| 121 | container.bind(IBreakpointConditionFactory).to(BreakpointConditionFactory).inSingletonScope(); |
| 122 | container.bind(LogPointCompiler).toSelf().inSingletonScope(); |
| 123 | |
| 124 | container |
| 125 | .bind(ITelemetryReporter) |
| 126 | .to(process.env.DA_TEST_DISABLE_TELEMETRY ? NullTelemetryReporter : DapTelemetryReporter) |
| 127 | .inSingletonScope() |
| 128 | .onActivation(trackDispose); |
| 129 | |
| 130 | container.bind(BreakpointManager).toSelf().inSingletonScope(); |
| 131 | |
| 132 | container.bind(SourceContainer).toSelf().inSingletonScope(); |
| 133 | |
| 134 | container.bind(IScriptSkipper).to(ScriptSkipper).inSingletonScope(); |
| 135 | |
| 136 | container.bind(ICompletions).to(Completions).inSingletonScope(); |
| 137 | |
| 138 | container.bind(IEvaluator).to(Evaluator).inSingletonScope(); |
| 139 | |
| 140 | container.bind(BasicCpuProfiler).toSelf(); |
| 141 | |
| 142 | container.bind(IProfilerFactory).to(ProfilerFactory).inSingletonScope(); |
| 143 | |
| 144 | container.bind(IProfileController).to(ProfileController).inSingletonScope(); |
| 145 | |
| 146 | return container; |
| 147 | }; |
| 148 | |
| 149 | export interface IRootOptions { |
| 150 | delegateLauncher: DelegateLauncherFactory; |
no test coverage detected