I’m trying to get started with Haxe using VS Code on Windows. I want to run my application with Hashlink, but when configuring the VS Code debugger the panels are blank. As in, no stack, no variables, nothing.
Building + running the application works, it shows when it’s stopped due to an error, and killing the program via the debugger controls works too. But there’s no information whatsoever in the IDE. No stack traces on error, not even an error message. Even when I’m manually throwing an error to test it, it doesn’t show a thing.
Does anyone know what I’m missing to get this working in VS Code?
I’m actually on Windows (updated my original post). I found your issue when searching for a solution, it was the only think that seemed somewhat similar to my situation so it may be caused by the same bug, but it’s about linux and you get “failed to connect to debug port” whereas I get that it’s connected but then no debugger information whatsoever.
Hopefully someone will come along soon with a solution to both our problems
Update: With the help of a maintainer of the VS Code extension, I was able to find the issue and fix it. It had to do with the extension returning null where it should have returned undefined. The pull request has been merged so this particular issue should be resolved as soon as a new release is published.
@jseb You’ll probably want to check if this also fixes your problem. If an update isn’t published soon, you can quickly patch your installed extension in [wherever your .vscode directory is on linux]/extensions/haxefoundation.haxe-hl-0.5.1/hladapter.js. Just search for null ? null (there should be only one occurrence) and change it to null ? undefined.
Hello, thank you for posting your solution. I’m glad that it worked for you, at least
I’ve made the suggested changes, but for me it doesn’t change. But just to be sure, can you tell me those step are correct for debugging ?
launch vscode
open project and put a breakpoint in the code.
C-S-d (invoke debugger)
at the top-left, choose HashLink launch and then press F5
At this step, my cpu goes 100% and i have this in my process: 28906 ? Rl 0:15 hl --debug-wait --debug 6112 test.hl
But nothing happens in vscode. (no informations in debug subwindows)
on the same menu, choose HashLink attach and then F5 again.
In the callstack of the debug subwindows, i see now: