From 24957e575c28798025c57262f60f6fb7332d200a Mon Sep 17 00:00:00 2001 From: Raimon Zamora Date: Sun, 12 Apr 2026 20:21:15 +0200 Subject: [PATCH] =?UTF-8?q?Versi=C3=B3=201.0.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 ++- .vscodeignore | 8 ++++++++ LICENSE | 21 +++++++++++++++++++++ adapter/debugAdapter.js | 15 ++++++++++++--- adapter/package.json | 2 +- extension.js | 4 ++-- package.json | 22 ++++++++++++---------- 7 files changed, 58 insertions(+), 17 deletions(-) create mode 100644 .vscodeignore create mode 100644 LICENSE diff --git a/.gitignore b/.gitignore index 5cb2a37..5f46f57 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -adapter/node_modules/* \ No newline at end of file +adapter/node_modules/* +*.vsix \ No newline at end of file diff --git a/.vscodeignore b/.vscodeignore new file mode 100644 index 0000000..e8dea96 --- /dev/null +++ b/.vscodeignore @@ -0,0 +1,8 @@ +.vscode/ +.git/ +.gitignore +adapter/node_modules/ +adapter/package-lock.json +adapter/package.json +**/*.map +**/*.ts diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..9a1338e --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 JailGames + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/adapter/debugAdapter.js b/adapter/debugAdapter.js index aed7da4..7ff3682 100644 --- a/adapter/debugAdapter.js +++ b/adapter/debugAdapter.js @@ -12,13 +12,13 @@ const { const { spawn } = require('child_process'); -class MyLuaDebugSession extends LoggingDebugSession { +class MiniDebugSession extends LoggingDebugSession { constructor() { super(); // Redirigir console.log a la Debug Console - console.log = (...args) => { this.sendEvent(new OutputEvent(args.join(" ") + "\n")); }; + //console.log = (...args) => { this.sendEvent(new OutputEvent(args.join(" ") + "\n")); }; console.log("Debug Adapter iniciado"); this._stackFrames = []; this.setDebuggerLinesStartAt1(true); @@ -109,6 +109,9 @@ constructor() { } if (json.type === "break") { + this._lastStackFrames = null; + this._lastTotalFrames = 0; + this.currentFile = json.file; this.currentLine = json.line; @@ -116,11 +119,17 @@ constructor() { return; } if (json.type === "step") { + this._lastStackFrames = null; + this._lastTotalFrames = 0; + this.sendEvent(new StoppedEvent("step", 1)); return; } if (json.type === "pause") { + this._lastStackFrames = null; + this._lastTotalFrames = 0; + this.sendEvent(new StoppedEvent("pause", 1)); return; } @@ -623,4 +632,4 @@ constructor() { } -new MyLuaDebugSession().start(process.stdin, process.stdout); +new MiniDebugSession().start(process.stdin, process.stdout); diff --git a/adapter/package.json b/adapter/package.json index 554354d..6c3cb6a 100644 --- a/adapter/package.json +++ b/adapter/package.json @@ -1,6 +1,6 @@ { "name": "mini-adapter", - "version": "0.0.1", + "version": "1.0.0", "main": "debugAdapter.js", "dependencies": { "vscode-debugadapter": "^1.51.0", diff --git a/extension.js b/extension.js index 60ebf0b..08b2f93 100644 --- a/extension.js +++ b/extension.js @@ -3,7 +3,7 @@ const path = require('path'); function activate(context) { const factory = { - createDebugAdapterDescriptor(session, executable) { + createDebugAdapterDescriptor(session) { const command = "node"; const args = [path.join(__dirname, "adapter", "debugAdapter.js")]; @@ -12,7 +12,7 @@ function activate(context) { }; const registration = vscode.debug.registerDebugAdapterDescriptorFactory( - "myLuaApp", + "mini-debugger", factory ); diff --git a/package.json b/package.json index d7a4621..fdb9dca 100644 --- a/package.json +++ b/package.json @@ -2,13 +2,17 @@ "name": "mini-debugger", "displayName": "Mini Debugger", "description": "Debug Lua inside my C/C++ application", - "version": "0.0.1", - "publisher": "raimon", + "version": "1.0.0", + "publisher": "JailGames", + "repository": { + "type": "git", + "url": "https://gitea.sustancia.synology.me/JailDoctor/mini-debugger" + }, "engines": { "vscode": "^1.85.0" }, "categories": ["Debuggers"], - "activationEvents": ["onDebug"], + "activationEvents": ["onDebug:mini-debugger"], "main": "./extension.js", "contributes": { "breakpoints": [ @@ -16,18 +20,16 @@ ], "debuggers": [ { - "type": "myLuaApp", - "label": "Debug My Lua App", - "program": "./adapter/debugAdapter.js", + "type": "mini-debugger", + "label": "Debugger for mini games", "runtime": "node", "languages": ["lua"], - "request": "launch", "initialConfigurations": [ { - "type": "myLuaApp", + "type": "mini-debugger", "request": "launch", - "name": "Debug My Lua App", - "program": "${workspaceFolder}/miapp" + "name": "Debugger for mini games", + "program": "${workspaceFolder}/mini_debug" } ], "configurationAttributes": {