COMMUNITY

How to debug hashlink in vscode?

after install everything in debug environment,
lauch debug ,but still not work

how to config launch.json? type=“what?”

{
	"version": "0.2.0",
	"configurations": [
		{
			"name": "Haxe Interpreter",
			
			"request": "launch",
			"args": ["build.hxml", "--interp"]
		}
	]
}

build.hxml

//------------------------
-cp src

-hl bin/sangong.hl

-lib ds


-main MainServer

-D SERVER

-D Debug

Here’s an example: https://github.com/Gama11/HaxeRepro/blob/c4061a64456c1f2a994dbcdd43e169339e37cf97/.vscode/launch.json#L29-L37

I’m copy your tips to lauch.json

and run HashLin/JIT

vscode give an waring box :slight_smile:
could not find the task “HL/JIT (debug)”

I click debug anyway ,it can jump into breakpoint.

wow ,thank you Gama11

The preLaunchTask property link to a task you want to run before starting debugging,
here it refers to this one https://github.com/Gama11/HaxeRepro/blob/c4061a64456c1f2a994dbcdd43e169339e37cf97/.vscode/tasks.json#L63-L77 which is used to build the code.

thank you ,I’ll try