Debug Macros

when I remember it correctly, at the last Haxe summit, Simon showed that it is possible from inside VSCode to debug macros with the new eval target.
If this is really possible, what settings do I need to enable this ?

Hi, yes, it’s really possible, there’s debugging support in the eval interpreter, but we never settled with the final protocol for the debugger UI interaction, so the VSCode extension wasn’t released yet. Still, it’s usable and actually helps, so I think I’ll prepare an alpha version of the extension with “can break with newer Haxe” note and write some README.


Great - thanks

Any news about the debugging extension? I have a somewhat complicated macro and I’d love to test-drive the new macro debugger. Is it documented somewhere?

Not yet, sorry. I had some issues with building the debug extension with latest vscode libs due to ES6 class incompatibilities and I haven’t got enough time to figure it out yet.

You can enable stacktraces with -D eval-stack which already helps with debugging, using Haxe 4 preview.

1 Like

@mark.knol Thanks! That’s helpful.

@nadako What ES6 class incompatibility, could you cite an example? Couldn’t that be solved with GitHub - kevinresol/hxgenjs: Extensible JS generator for Haxe?

IIRC it was about not being able to extend the ES6 class using ES5 way to call the super constructor which Haxe currently generates, so it’s basically Add ES6 class support · Issue #6546 · HaxeFoundation/haxe · GitHub. Unfortunately I don’t have time to work on this at the moment because of the new job, but once I settle down a bit I’m going to get back to the issue.