microsoft/vscode-react-native
Publicmirrored from https://github.com/microsoft/vscode-react-nativeAvailable
src/extension/debuggingConfiguration/configurationProviders/configProviderFactory.ts
23lines · modeblame
5471436aRedMickey5 years ago | 1 | // Copyright (c) Microsoft Corporation. All rights reserved. |
| 2 | // Licensed under the MIT license. See LICENSE file in the project root for details. | |
| 3 | | |
09f6024fHeniker4 years ago | 4 | import { DebugScenarioType } from "../debugConfigTypesAndConstants"; |
5471436aRedMickey5 years ago | 5 | import { RunConfigProvider } from "./runConfigProvider"; |
| 6 | import { DebugConfigProvider } from "./debugConfigProvider"; | |
| 7 | import { AttachConfigProvider } from "./attachConfigProvider"; | |
| 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 | } |