Versió 1.0.0

This commit is contained in:
2026-04-12 20:21:15 +02:00
parent 9c11af0e08
commit 24957e575c
7 changed files with 58 additions and 17 deletions

3
.gitignore vendored
View File

@@ -1 +1,2 @@
adapter/node_modules/* adapter/node_modules/*
*.vsix

8
.vscodeignore Normal file
View File

@@ -0,0 +1,8 @@
.vscode/
.git/
.gitignore
adapter/node_modules/
adapter/package-lock.json
adapter/package.json
**/*.map
**/*.ts

21
LICENSE Normal file
View File

@@ -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.

View File

@@ -12,13 +12,13 @@ const {
const { spawn } = require('child_process'); const { spawn } = require('child_process');
class MyLuaDebugSession extends LoggingDebugSession { class MiniDebugSession extends LoggingDebugSession {
constructor() { constructor() {
super(); super();
// Redirigir console.log a la Debug Console // 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"); console.log("Debug Adapter iniciado");
this._stackFrames = []; this._stackFrames = [];
this.setDebuggerLinesStartAt1(true); this.setDebuggerLinesStartAt1(true);
@@ -109,6 +109,9 @@ constructor() {
} }
if (json.type === "break") { if (json.type === "break") {
this._lastStackFrames = null;
this._lastTotalFrames = 0;
this.currentFile = json.file; this.currentFile = json.file;
this.currentLine = json.line; this.currentLine = json.line;
@@ -116,11 +119,17 @@ constructor() {
return; return;
} }
if (json.type === "step") { if (json.type === "step") {
this._lastStackFrames = null;
this._lastTotalFrames = 0;
this.sendEvent(new StoppedEvent("step", 1)); this.sendEvent(new StoppedEvent("step", 1));
return; return;
} }
if (json.type === "pause") { if (json.type === "pause") {
this._lastStackFrames = null;
this._lastTotalFrames = 0;
this.sendEvent(new StoppedEvent("pause", 1)); this.sendEvent(new StoppedEvent("pause", 1));
return; return;
} }
@@ -623,4 +632,4 @@ constructor() {
} }
new MyLuaDebugSession().start(process.stdin, process.stdout); new MiniDebugSession().start(process.stdin, process.stdout);

View File

@@ -1,6 +1,6 @@
{ {
"name": "mini-adapter", "name": "mini-adapter",
"version": "0.0.1", "version": "1.0.0",
"main": "debugAdapter.js", "main": "debugAdapter.js",
"dependencies": { "dependencies": {
"vscode-debugadapter": "^1.51.0", "vscode-debugadapter": "^1.51.0",

View File

@@ -3,7 +3,7 @@ const path = require('path');
function activate(context) { function activate(context) {
const factory = { const factory = {
createDebugAdapterDescriptor(session, executable) { createDebugAdapterDescriptor(session) {
const command = "node"; const command = "node";
const args = [path.join(__dirname, "adapter", "debugAdapter.js")]; const args = [path.join(__dirname, "adapter", "debugAdapter.js")];
@@ -12,7 +12,7 @@ function activate(context) {
}; };
const registration = vscode.debug.registerDebugAdapterDescriptorFactory( const registration = vscode.debug.registerDebugAdapterDescriptorFactory(
"myLuaApp", "mini-debugger",
factory factory
); );

View File

@@ -2,13 +2,17 @@
"name": "mini-debugger", "name": "mini-debugger",
"displayName": "Mini Debugger", "displayName": "Mini Debugger",
"description": "Debug Lua inside my C/C++ application", "description": "Debug Lua inside my C/C++ application",
"version": "0.0.1", "version": "1.0.0",
"publisher": "raimon", "publisher": "JailGames",
"repository": {
"type": "git",
"url": "https://gitea.sustancia.synology.me/JailDoctor/mini-debugger"
},
"engines": { "engines": {
"vscode": "^1.85.0" "vscode": "^1.85.0"
}, },
"categories": ["Debuggers"], "categories": ["Debuggers"],
"activationEvents": ["onDebug"], "activationEvents": ["onDebug:mini-debugger"],
"main": "./extension.js", "main": "./extension.js",
"contributes": { "contributes": {
"breakpoints": [ "breakpoints": [
@@ -16,18 +20,16 @@
], ],
"debuggers": [ "debuggers": [
{ {
"type": "myLuaApp", "type": "mini-debugger",
"label": "Debug My Lua App", "label": "Debugger for mini games",
"program": "./adapter/debugAdapter.js",
"runtime": "node", "runtime": "node",
"languages": ["lua"], "languages": ["lua"],
"request": "launch",
"initialConfigurations": [ "initialConfigurations": [
{ {
"type": "myLuaApp", "type": "mini-debugger",
"request": "launch", "request": "launch",
"name": "Debug My Lua App", "name": "Debugger for mini games",
"program": "${workspaceFolder}/miapp" "program": "${workspaceFolder}/mini_debug"
} }
], ],
"configurationAttributes": { "configurationAttributes": {