Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>DeLorean JS DebugNew to Visual Studio Code? Get it now.

DeLorean JS Debug

Henning Dieterichs

|
161 installs
| (0) | Free
This extension enables time travel debugging of pure functions (requires TypeScript and a custom transformer)
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

DeLorean JS Debug: Step Back In (Pure) Functions

Usage

Only works with TypeScript and requires custom transformers! You can step back in any function, but global side effects are not reversed.

Annotate functions/methods with /** @pure */ to indicate that they are pure (for example test methods are usually pure). If there is a pure function/method on the stack, stepping back will restart the most recently called pure function to reverse local side effects.

Install @hediet/delorean-debug-transformer and add it to your tsconfig.json:

{
	"compilerOptions": {
		"plugins": [{ "transform": "@hediet/delorean-debug-transformer" }],
		"outDir": "out",
		"target": "es5",
		"module": "commonjs",
		"strict": true,
		"inlineSourceMap": true
	},
	"include": ["./src/**/*"]
}

Install ts-patch and run ts-patch install to make tsc consider plugins. I recommend to do that in a postinstall script (see demo).

Demo

See demo.

Debug Visualizer

This extension works nicely with the Debug Visualizer extension:

  • Contact us
  • Jobs
  • Privacy
  • Terms of use
  • Trademarks
© 2023 Microsoft