Skip to content

Commit

Permalink
Add Hermes Expo debugger in debug-alt menu (#1942)
Browse files Browse the repository at this point in the history
  • Loading branch information
EzioLi01 authored Apr 12, 2023
1 parent 83879a3 commit 0b86204
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
15 changes: 15 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,13 @@
"enablement": "!config.security.workspace.trust.enabled && !inDebugMode || isWorkspaceTrusted && !inDebugMode",
"icon": "$(debug-alt)"
},
{
"command": "reactNative.debugScenario.debugInHermesExponentExperimental",
"title": "Debug in Hermes Exponent - Experimental",
"category": "React Native",
"enablement": "!config.security.workspace.trust.enabled && !inDebugMode || isWorkspaceTrusted && !inDebugMode",
"icon": "$(debug-alt)"
},
{
"command": "reactNative.debugScenario.debugAndroidHermesExperimental",
"title": "Debug Android Hermes - Experimental",
Expand Down Expand Up @@ -410,6 +417,10 @@
"command": "reactNative.debugScenario.debugInExponent",
"when": "isRNProject && config.react-native-tools.displayDebuggingCommandsButton"
},
{
"command": "reactNative.debugScenario.debugInHermesExponentExperimental",
"when": "isRNProject && config.react-native-tools.displayDebuggingCommandsButton"
},
{
"command": "reactNative.debugScenario.debugAndroidHermesExperimental",
"when": "isRNProject && isRNAndroidHermesProject && config.react-native-tools.displayDebuggingCommandsButton"
Expand Down Expand Up @@ -488,6 +499,10 @@
"command": "reactNative.debugScenario.debugInExponent",
"when": "false"
},
{
"command": "reactNative.debugScenario.debugInHermesExponentExperimental",
"when": "false"
},
{
"command": "reactNative.debugScenario.debugAndroidHermesExperimental",
"when": "false"
Expand Down
17 changes: 17 additions & 0 deletions src/extension/commands/debugScenario.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,23 @@ export class DebugInExponent extends Command {
}
}

export class DebugInHermesExponent extends Command {
codeName = "debugScenario.debugInHermesExponentExperimental";
label = "";
error = ErrorHelper.getInternalError(
InternalErrorCode.DebuggingCommandFailed,
DEBUG_CONFIGURATION_NAMES.DEBUG_IN_EXPONENT_HERMES_EXPERIMENTAL,
);

async baseFn(): Promise<void> {
assert(this.project);
startDebug(
debugConfigurations[DEBUG_CONFIGURATION_NAMES.DEBUG_IN_EXPONENT_HERMES_EXPERIMENTAL],
this.project,
);
}
}

export class DebugAndroidHermesExperimental extends Command {
codeName = "debugScenario.debugAndroidHermesExperimental";
label = "";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,13 @@ export class ReactNativeDebugConfigProvider implements vscode.DebugConfiguration
"Debug Expo application or React Native application in Expo",
),
},
{
label: DEBUG_CONFIGURATION_NAMES.DEBUG_IN_EXPONENT_HERMES_EXPERIMENTAL,
description: localize(
"DebugHermesExpoConfigDesc",
"Debug Hermes Expo application or React Native application in Expo",
),
},
{
label: DEBUG_CONFIGURATION_NAMES.DEBUG_ANDROID_HERMES,
description: localize(
Expand Down

0 comments on commit 0b86204

Please sign in to comment.