Version 2.2.0.

* Adds support for custom injected scripts with automatic reload
* Refactors extension
This commit is contained in:
Henning Dieterichs
2021-06-18 20:26:51 +02:00
parent 6ce5d666a3
commit d22e5d4111
46 changed files with 1421 additions and 716 deletions

View File

@@ -0,0 +1,41 @@
import { Disposable } from "@hediet/std/disposable";
import { debug, DebugSession } from "vscode";
import { observable, action } from "mobx";
import { DebuggerProxy } from "./DebuggerProxy";
import { DebugSessionProxy } from "./DebugSessionProxy";
/**
* Tracks the currently active debug session and its currently active stack frame.
* This is currently all faked. A proper API would be nice.
*/
export class DebuggerViewProxy {
public readonly dispose = Disposable.fn();
@observable private _activeDebugSession: DebugSessionProxy | undefined;
public get activeDebugSession(): DebugSessionProxy | undefined {
return this._activeDebugSession;
}
public getActiveStackFrameId(
session: DebugSessionProxy
): number | undefined {
return session["_activeStackFrameId"];
}
constructor(private debuggerProxy: DebuggerProxy) {
this.dispose.track(
debug.onDidChangeActiveDebugSession(activeSession => {
this.updateActiveDebugSession(activeSession);
})
);
this.updateActiveDebugSession(debug.activeDebugSession);
}
@action
private updateActiveDebugSession(activeSession: DebugSession | undefined) {
this._activeDebugSession = activeSession
? this.debuggerProxy.getDebugSessionProxy(activeSession)
: undefined;
}
}