From 9ddcbeebc3d1f38306e59513d8ab8be612e752bd Mon Sep 17 00:00:00 2001 From: Raimon Zamora Date: Tue, 31 Mar 2026 14:02:24 +0200 Subject: [PATCH] =?UTF-8?q?-=20[NEW]=20Logpoints=20-=20[NEW]=20Expresions?= =?UTF-8?q?=20d'assignaci=C3=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- adapter/debugAdapter.js | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/adapter/debugAdapter.js b/adapter/debugAdapter.js index 58d8d1a..5da2726 100644 --- a/adapter/debugAdapter.js +++ b/adapter/debugAdapter.js @@ -202,7 +202,7 @@ constructor() { } r.body = { - result: v.value, + result: v.value ?? "", variablesReference }; @@ -221,6 +221,11 @@ constructor() { } } + if (json.type === "log") { + this.sendEvent(new OutputEvent(json.payload.text + "\n")); + return; + } + // salida normal this.sendEvent(new OutputEvent(line + "\n", "stdout")); } @@ -503,14 +508,27 @@ constructor() { } evaluateRequest(response, args) { - console.log("[ADAPTER] evaluateRequest:", args.expression); + const expr = args.expression; + const frameId = args.frameId ?? 0; + + // Detectar asignación: contiene "=" y no empieza por "==" + const isAssign = expr.includes("=") && !expr.includes("=="); this._pendingEval = response; - this.sendDebugCommand({ - cmd: "eval", - expr: args.expression - }); + if (isAssign) { + this.sendDebugCommand({ + cmd: "evalAssign", + frame: frameId, + expr: expr + }); + } else { + this.sendDebugCommand({ + cmd: "eval", + expr: expr, + frame: frameId + }); + } } setVariableRequest(response, args) {