mirror of
https://github.com/oven-sh/bun
synced 2026-02-02 15:08:46 +00:00
Fix breakpoint on entry for extension
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -8,7 +8,7 @@ export default {
|
||||
};
|
||||
const coolThing: CoolThing = new SuperCoolThing();
|
||||
coolThing.doCoolThing();
|
||||
return new Response("Hello World");
|
||||
return new Response("Hello World??");
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
8
packages/bun-vscode/example/hello.js
Normal file
8
packages/bun-vscode/example/hello.js
Normal file
@@ -0,0 +1,8 @@
|
||||
console.log("HELLO");
|
||||
console.log("HELLO 2");
|
||||
console.log("HELLO 3");
|
||||
a();
|
||||
|
||||
function a() {
|
||||
console.log("HELLO 4");
|
||||
}
|
||||
@@ -242,18 +242,10 @@
|
||||
],
|
||||
"priority": "default"
|
||||
}
|
||||
],
|
||||
"terminal": {
|
||||
"profiles": [
|
||||
{
|
||||
"title": "Bun Terminal",
|
||||
"id": "bun"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"description": "The Visual Studio Code extension for Bun.",
|
||||
"displayName": "Bun",
|
||||
"displayName": "Bun for Visual Studio Code",
|
||||
"engines": {
|
||||
"vscode": "^1.81.0"
|
||||
},
|
||||
@@ -284,7 +276,6 @@
|
||||
},
|
||||
"workspaces": [
|
||||
"../bun-debug-adapter-protocol",
|
||||
"../bun-inspector-protocol",
|
||||
"../bun-wasm"
|
||||
"../bun-inspector-protocol"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -46,7 +46,6 @@ export default function (context: vscode.ExtensionContext, factory?: vscode.Debu
|
||||
vscode.DebugConfigurationProviderTriggerKind.Dynamic,
|
||||
),
|
||||
vscode.debug.registerDebugAdapterDescriptorFactory("bun", factory ?? new InlineDebugAdapterFactory()),
|
||||
vscode.window.registerTerminalProfileProvider("bun", new TerminalProfileProvider()),
|
||||
vscode.window.onDidOpenTerminal(InjectDebugTerminal),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user