mirror of
https://github.com/oven-sh/bun
synced 2026-02-02 15:08:46 +00:00
Fix VSCode extension hanging (#15407)
This commit is contained in:
@@ -294,7 +294,7 @@ export abstract class BaseDebugAdapter<T extends Inspector = Inspector>
|
||||
|
||||
/**
|
||||
* Gets the inspector url. This is deprecated and exists for compat.
|
||||
* @deprecated You should get the inspector directly, and if it's a WebSocketInspector you can access `.url` direclty.
|
||||
* @deprecated You should get the inspector directly (with .getInspector()), and if it's a WebSocketInspector you can access `.url` direclty.
|
||||
*/
|
||||
get url(): string {
|
||||
// This code has been migrated from a time when the inspector was always a WebSocketInspector.
|
||||
@@ -305,6 +305,10 @@ export abstract class BaseDebugAdapter<T extends Inspector = Inspector>
|
||||
throw new Error("Inspector does not offer a URL");
|
||||
}
|
||||
|
||||
public getInspector() {
|
||||
return this.inspector;
|
||||
}
|
||||
|
||||
abstract start(...args: unknown[]): Promise<boolean>;
|
||||
|
||||
/**
|
||||
@@ -2064,7 +2068,7 @@ export class NodeSocketDebugAdapter extends BaseDebugAdapter<NodeSocketInspector
|
||||
/**
|
||||
* The default debug adapter. Connects via WebSocket
|
||||
*/
|
||||
export class DebugAdapter extends BaseDebugAdapter<WebSocketInspector> {
|
||||
export class WebSocketDebugAdapter extends BaseDebugAdapter<WebSocketInspector> {
|
||||
#process?: ChildProcess;
|
||||
|
||||
public constructor(url?: string | URL, untitledDocPath?: string, bunEvalPath?: string) {
|
||||
@@ -2331,6 +2335,8 @@ export class DebugAdapter extends BaseDebugAdapter<WebSocketInspector> {
|
||||
}
|
||||
}
|
||||
|
||||
export const DebugAdapter = WebSocketDebugAdapter;
|
||||
|
||||
function stoppedReason(reason: JSC.Debugger.PausedEvent["reason"]): DAP.StoppedEvent["reason"] {
|
||||
switch (reason) {
|
||||
case "Breakpoint":
|
||||
|
||||
Reference in New Issue
Block a user