(parent: Container)
| 232 | * shared/global services. |
| 233 | */ |
| 234 | export const createTopLevelSessionContainer = (parent: Container) => { |
| 235 | const container = new Container(); |
| 236 | container.parent = parent; |
| 237 | container.bind(IContainer).toConstantValue(container); |
| 238 | |
| 239 | // Core services: |
| 240 | container.bind(ILogger).to(Logger).inSingletonScope().onActivation(trackDispose); |
| 241 | container.bind(IResourceProvider).to(StatefulResourceProvider).inSingletonScope(); |
| 242 | container |
| 243 | .bind(ITelemetryReporter) |
| 244 | .to(process.env.DA_TEST_DISABLE_TELEMETRY ? NullTelemetryReporter : DapTelemetryReporter) |
| 245 | .inSingletonScope() |
| 246 | .onActivation(trackDispose); |
| 247 | |
| 248 | container.bind(OutFiles).to(OutFiles).inSingletonScope(); |
| 249 | container.bind(VueComponentPaths).to(VueComponentPaths).inSingletonScope(); |
| 250 | container.bind(IVueFileMapper).to(VueFileMapper).inSingletonScope(); |
| 251 | container.bind(ISearchStrategy).to(TurboSearchStrategy).inSingletonScope(); |
| 252 | |
| 253 | container.bind(INodeBinaryProvider).to(InteractiveNodeBinaryProvider); |
| 254 | container.bind(RemoteBrowserHelper).toSelf().inSingletonScope().onActivation(trackDispose); |
| 255 | |
| 256 | // Launcher logic: |
| 257 | container.bind(RestartPolicyFactory).toSelf(); |
| 258 | container.bind(ILauncher).to(VSCodeRendererAttacher).onActivation(trackDispose); |
| 259 | container.bind(ILauncher).to(ExtensionHostAttacher).onActivation(trackDispose); |
| 260 | container.bind(ILauncher).to(ExtensionHostLauncher).onActivation(trackDispose); |
| 261 | container.bind(ILauncher).to(NodeLauncher).onActivation(trackDispose); |
| 262 | container.bind(IProgramLauncher).to(SubprocessProgramLauncher); |
| 263 | container.bind(IProgramLauncher).to(TerminalProgramLauncher); |
| 264 | container.bind(IPackageJsonProvider).to(PackageJsonProvider).inSingletonScope(); |
| 265 | |
| 266 | registerTopLevelSessionComponents(container); |
| 267 | |
| 268 | container.bind(ILauncher).to(NodeAttacher).onActivation(trackDispose); |
| 269 | |
| 270 | container.bind(ChromeLauncher).toSelf().inSingletonScope().onActivation(trackDispose); |
| 271 | container.bind(ILauncher).toService(ChromeLauncher); |
| 272 | container.bind(ILauncher).to(EdgeLauncher).inSingletonScope().onActivation(trackDispose); |
| 273 | container.bind(ILauncher).to(RemoteBrowserLauncher).inSingletonScope().onActivation( |
| 274 | trackDispose, |
| 275 | ); |
| 276 | container.bind(ILauncher).to(RemoteBrowserAttacher).inSingletonScope().onActivation( |
| 277 | trackDispose, |
| 278 | ); |
| 279 | container |
| 280 | .bind(ILauncher) |
| 281 | .to(UWPWebviewBrowserAttacher) |
| 282 | .inSingletonScope() |
| 283 | .onActivation(trackDispose); |
| 284 | |
| 285 | container.bind(ILauncher).to(BrowserAttacher).onActivation(trackDispose); |
| 286 | container |
| 287 | .bind(ILauncher) |
| 288 | .toDynamicValue(() => |
| 289 | parent.get(DelegateLauncherFactory).createLauncher(container.get(ILogger)) |
| 290 | ) |
| 291 | .inSingletonScope(); |
no test coverage detected