Fix breakpoint on entry for extension

This commit is contained in:
Ashcon Partovi
2023-09-01 10:19:14 -07:00
parent 1ff8155c28
commit 2b421be06f
5 changed files with 15 additions and 18 deletions

View File

@@ -449,6 +449,7 @@ export class DebugAdapter extends EventEmitter<DebugAdapterEventMap> implements
env = {},
strictEnv = false,
watchMode = false,
stopOnEntry = false,
} = request;
if (!program) {
@@ -489,10 +490,8 @@ export class DebugAdapter extends EventEmitter<DebugAdapterEventMap> implements
signal.close();
});
// Break on entry is always set so the debugger has a chance
// to set breakpoints before the program starts. If `stopOnEntry`
// was not set, then the debugger will auto-continue after the first pause.
processEnv["BUN_INSPECT"] = `${url}?break=1`;
const query = stopOnEntry ? "break=1" : "wait=1";
processEnv["BUN_INSPECT"] = `${url}?${query}`;
processEnv["BUN_INSPECT_NOTIFY"] = signal.url;
// This is probably not correct, but it's the best we can do for now.