This commit is contained in:
LenAnderson
2024-06-22 10:44:34 -04:00
parent ec122d7050
commit e964a10612
6 changed files with 213 additions and 23 deletions

View File

@ -213,6 +213,7 @@ export class SlashCommandClosure {
let done = 0;
for (const executor of this.executorList) {
this.onProgress?.(done, this.commandCount);
this.debugController?.setExecutor(executor);
yield executor;
if (executor instanceof SlashCommandClosureExecutor) {
const closure = this.scope.getVariable(executor.name);

View File

@ -3,6 +3,7 @@ import { SlashCommandExecutor } from './SlashCommandExecutor.js';
export class SlashCommandDebugController {
/**@type {SlashCommandClosure[]} */ stack = [];
/**@type {SlashCommandExecutor[]} */ cmdStack = [];
/**@type {boolean[]} */ stepStack = [];
/**@type {boolean} */ isStepping = false;
/**@type {boolean} */ isSteppingInto = false;
@ -31,9 +32,14 @@ export class SlashCommandDebugController {
}
up() {
this.stack.pop();
while (this.cmdStack.length > this.stack.length) this.cmdStack.pop();
this.stepStack.pop();
}
setExecutor(executor) {
this.cmdStack[this.stack.length - 1] = executor;
}
resume() {