microsoft/vscode-react-native

Public

mirrored from https://github.com/microsoft/vscode-react-nativeAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
1.3.0

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

src/extension/debuggingConfiguration/debugConfigTypesAndConstants.ts

108lines · 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
4import { PlatformType } from "../launchArgs";
5import { ILaunchRequestArgs } from "../../debugger/debugSessionBase";
6import * as vscode from "vscode";
7import * as nls from "vscode-nls";
8nls.config({
9 messageFormat: nls.MessageFormat.bundle,
10 bundleFormat: nls.BundleFormat.standalone,
11})();
12const localize = nls.loadMessageBundle();
13
14export interface DebugConfigurationState {
15 config: Partial<ILaunchRequestArgs>;
16 scenarioType: DebugScenarioType;
17 folder?: vscode.WorkspaceFolder;
18 token?: vscode.CancellationToken;
19}
20
21export type DebugConfigurationQuickPickItem = vscode.QuickPickItem & { type: string };
22
23export enum DebugScenarioType {
24 RunApp = "runapp",
25 DebugApp = "debugapp",
26 AttachApp = "attachapp",
27}
28
29export const DEBUG_TYPES = {
30 REACT_NATIVE: "reactnative",
31 REACT_NATIVE_DIRECT: "reactnativedirect",
32};
33
34export const platformTypeRunPickConfig: DebugConfigurationQuickPickItem[] = [
35 {
36 label: "Android",
37 type: PlatformType.Android,
38 },
39 {
40 label: "iOS",
41 type: PlatformType.iOS,
42 },
43 {
44 label: "MacOS",
45 type: PlatformType.macOS,
46 },
47 {
48 label: "Windows",
49 type: PlatformType.Windows,
50 },
51];
52
53export const platformTypeDebugPickConfig: DebugConfigurationQuickPickItem[] = [
54 ...platformTypeRunPickConfig,
55 {
56 label: "Exponent",
57 type: PlatformType.Exponent,
58 },
59];
60
61export const platformTypeDirectPickConfig: DebugConfigurationQuickPickItem[] = [
62 {
63 label: "Android Hermes - Experimental",
64 type: PlatformType.Android,
65 },
66 {
67 label: "Direct iOS - Experimental",
68 type: PlatformType.iOS,
69 },
70];
71
72export const appTypePickConfig: DebugConfigurationQuickPickItem[] = [
73 {
74 label: "Application in direct mode",
75 type: DEBUG_TYPES.REACT_NATIVE_DIRECT,
76 },
77 {
78 label: "Classic application",
79 type: DEBUG_TYPES.REACT_NATIVE,
80 },
81];
82
83export const expoHostTypePickConfig: DebugConfigurationQuickPickItem[] = [
84 {
85 label: "Tunnel",
86 description: localize(
87 "expoHostTypeTunnel",
88 "Allows to deploy and debug an application by means of Expo cloud services",
89 ),
90 type: "tunnel",
91 },
92 {
93 label: "LAN",
94 description: localize(
95 "expoHostTypeLAN",
96 "Allows to deploy and install an application via your LAN",
97 ),
98 type: "lan",
99 },
100 {
101 label: "Local",
102 description: localize(
103 "expoHostTypeLocal",
104 "Allows to debug an application on an emulator or an Android device without network connection",
105 ),
106 type: "local",
107 },
108];
109