From c8f9394614a5206782e0e6e141c9b3d262bd3997 Mon Sep 17 00:00:00 2001 From: Raimon Zamora Date: Mon, 13 Apr 2026 11:10:08 +0200 Subject: [PATCH] =?UTF-8?q?Versi=C3=B3=201.0.10:=20Un=20mont=C3=B3=20de=20?= =?UTF-8?q?FIXos=20pa=20que=20funcione=20en=20release?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vscodeignore | 3 --- adapter/debugAdapter.js | 3 ++- adapter/package.json | 2 +- extension.js | 11 ++++++----- package.json | 15 +++++++++++---- 5 files changed, 20 insertions(+), 14 deletions(-) diff --git a/.vscodeignore b/.vscodeignore index e8dea96..31fba01 100644 --- a/.vscodeignore +++ b/.vscodeignore @@ -1,8 +1,5 @@ .vscode/ .git/ .gitignore -adapter/node_modules/ -adapter/package-lock.json -adapter/package.json **/*.map **/*.ts diff --git a/adapter/debugAdapter.js b/adapter/debugAdapter.js index 7ff3682..4911259 100644 --- a/adapter/debugAdapter.js +++ b/adapter/debugAdapter.js @@ -20,6 +20,7 @@ constructor() { // Redirigir console.log a la Debug Console //console.log = (...args) => { this.sendEvent(new OutputEvent(args.join(" ") + "\n")); }; console.log("Debug Adapter iniciado"); + this._stackFrames = []; this.setDebuggerLinesStartAt1(true); this.setDebuggerColumnsStartAt1(true); @@ -263,7 +264,7 @@ constructor() { console.log("[ADAPTER] launchRequest"); const program = args.program; - const cwd = args.cwd || process.cwd(); + const cwd = args.cwd || args.workspaceFolder || process.cwd(); this.process = spawn(program, [], { cwd: cwd, diff --git a/adapter/package.json b/adapter/package.json index 6c3cb6a..0867fb5 100644 --- a/adapter/package.json +++ b/adapter/package.json @@ -1,6 +1,6 @@ { "name": "mini-adapter", - "version": "1.0.0", + "version": "1.0.10", "main": "debugAdapter.js", "dependencies": { "vscode-debugadapter": "^1.51.0", diff --git a/extension.js b/extension.js index 08b2f93..91bd623 100644 --- a/extension.js +++ b/extension.js @@ -2,6 +2,7 @@ const vscode = require('vscode'); const path = require('path'); function activate(context) { + const factory = { createDebugAdapterDescriptor(session) { const command = "node"; @@ -11,12 +12,12 @@ function activate(context) { } }; - const registration = vscode.debug.registerDebugAdapterDescriptorFactory( - "mini-debugger", - factory + context.subscriptions.push( + vscode.debug.registerDebugAdapterDescriptorFactory( + "mini-debugger", + factory + ) ); - - context.subscriptions.push(registration); } function deactivate() {} diff --git a/package.json b/package.json index fdb9dca..3c8e170 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "mini-debugger", "displayName": "Mini Debugger", "description": "Debug Lua inside my C/C++ application", - "version": "1.0.0", + "version": "1.0.10", "publisher": "JailGames", "repository": { "type": "git", @@ -12,7 +12,10 @@ "vscode": "^1.85.0" }, "categories": ["Debuggers"], - "activationEvents": ["onDebug:mini-debugger"], + "activationEvents": [ + "onDebug", + "onCommand:mini-debugger.adapterExecutable" + ], "main": "./extension.js", "contributes": { "breakpoints": [ @@ -22,14 +25,14 @@ { "type": "mini-debugger", "label": "Debugger for mini games", - "runtime": "node", "languages": ["lua"], "initialConfigurations": [ { "type": "mini-debugger", "request": "launch", "name": "Debugger for mini games", - "program": "${workspaceFolder}/mini_debug" + "program": "${workspaceFolder}/mini_debug", + "cwd": "${workspaceFolder}" } ], "configurationAttributes": { @@ -38,6 +41,10 @@ "program": { "type": "string", "description": "Ruta a tu aplicación C/C++" + }, + "cwd": { + "type": "string", + "description": "Directorio de trabajo del programa" } }, "required": ["program"]