Need help with configuring HashLink Debugger for vscode


Here’s my launch.json

        "name": "HashLink",
        "type": "hl",
        "request": "launch",
        "cwd": "${workspaceFolder}/Export/hl/bin",
        "hxml": "${workspaceFolder}/Export/hl/haxe/debug.hxml",
        "program": "${workspaceFolder}/Export/hl/obj/ApplicationMain.hl"

I need to set the cwd to the directory with lime.hdll otherwise hl cannot find it. Alternatively I’ve tried copying the hdll to the obj directory with ‘ApplicationMain.hl’ and that works too.

When I tried starting the debugger I kept running into an ‘Access Violation’. It took a while but I realised I needed to run vscode in Administrator Mode.
Now it runs, but it doesn’t hit any breakpoints.
I’ve realised however, if I throw an error in my Main class, vscode opens a new Main.hx window with the text ‘Unknown file Main.hx’.

I’m guessing it can’t find my source files so it can’t monitor any breakpoints.
Any ideas how to fix this?



You’d need to replace -cp Source in the hxml with an absolute path (copy it to a new hxml file next to it so it doesn’t get overwritten on build).



I have a fork of the HashLink extension I was working:

I think it would be best to remove the requirement for a cwd + HXML file (which wasn’t working properly for me) and allow only the executable