microsoft/vscode-react-native

Public

mirrored fromhttps://github.com/microsoft/vscode-react-nativeAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
4cd259621ddfbd348fade892a2f3ee87fd1924c5

Branches

Tags

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

Clone

HTTPS

Download ZIP

src/extension/debuggingConfiguration/debugConfigTypesAndConstants.ts

119lines · 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: "Hermes engine - Experimental",
64 type: "",
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 shouldUseHermesEngine: DebugConfigurationQuickPickItem[] = [
84 {
85 label: "Yes",
86 type: "yes",
87 },
88 {
89 label: "No",
90 type: "no",
91 },
92];
93
94export const expoHostTypePickConfig: DebugConfigurationQuickPickItem[] = [
95 {
96 label: "Tunnel",
97 description: localize(
98 "expoHostTypeTunnel",
99 "Allows to deploy and debug an application by means of Expo cloud services",
100 ),
101 type: "tunnel",
102 },
103 {
104 label: "LAN",
105 description: localize(
106 "expoHostTypeLAN",
107 "Allows to deploy and install an application via your LAN",
108 ),
109 type: "lan",
110 },
111 {
112 label: "Local",
113 description: localize(
114 "expoHostTypeLocal",
115 "Allows to debug an application on an emulator or an Android device without network connection",
116 ),
117 type: "local",
118 },
119];