From d740d81f41a518188a50982134152659cf345fde Mon Sep 17 00:00:00 2001 From: filip131311 Date: Wed, 23 Oct 2024 19:02:39 +0200 Subject: [PATCH] fixes after CR --- packages/vscode-extension/src/debugging/DebugAdapter.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/vscode-extension/src/debugging/DebugAdapter.ts b/packages/vscode-extension/src/debugging/DebugAdapter.ts index db30f42c..3f49896c 100644 --- a/packages/vscode-extension/src/debugging/DebugAdapter.ts +++ b/packages/vscode-extension/src/debugging/DebugAdapter.ts @@ -203,11 +203,12 @@ export class DebugAdapter extends DebugSession { // some logs may baypass that, especially when printed in initialization phase, so we // need to detect whether the wrapper has added the stack info or not // We check if there are more than 3 arguments, and if the last one is a number - // We also check if the log is not internal to avoid exposing it as part of - // application logs. + // We filter out logs that start with __RNIDE_INTERNAL as those are messages + // used by IDE for tracking the app state and should not appear in the VSCode + // console. const argsLen = message.params.args.length; let output: OutputEvent; - if (message.params.args[0].value === "__RNIDE_INTERNAL") { + if (argsLen > 0 && message.params.args[0].value === "__RNIDE_INTERNAL") { return; } else if (argsLen > 3 && message.params.args[argsLen - 1].type === "number") { // Since console.log stack is extracted from Error, unlike other messages sent over CDP