microsoft/vscode-react-native
Publicmirrored fromhttps://github.com/microsoft/vscode-react-nativeAvailable
src/extension/debuggingConfiguration/configurationProviders/configProviderFactory.ts
23lines · modecode
| 1 | // Copyright (c) Microsoft Corporation. All rights reserved. |
| 2 | // Licensed under the MIT license. See LICENSE file in the project root for details. |
| 3 | |
| 4 | import { RunConfigProvider } from "./runConfigProvider"; |
| 5 | import { DebugConfigProvider } from "./debugConfigProvider"; |
| 6 | import { AttachConfigProvider } from "./attachConfigProvider"; |
| 7 | import { DebugScenarioType } from "../debugConfigTypesAndConstants"; |
| 8 | import { BaseConfigProvider } from "./baseConfigProvider"; |
| 9 | |
| 10 | export class ConfigProviderFactory { |
| 11 | public static create(configurationType: string): BaseConfigProvider { |
| 12 | switch (configurationType) { |
| 13 | case DebugScenarioType.RunApp: |
| 14 | return new RunConfigProvider(); |
| 15 | case DebugScenarioType.DebugApp: |
| 16 | return new DebugConfigProvider(); |
| 17 | case DebugScenarioType.AttachApp: |
| 18 | return new AttachConfigProvider(); |
| 19 | default: |
| 20 | throw new Error(`Couldn't find ${configurationType} config adapter type`); |
| 21 | } |
| 22 | } |
| 23 | } |
| 24 | |