Debugging should be easy, except when it’s annoying.
A debug failing to start in Visual code is up there on my top pet peeves with a piece of celery on your teeth, loud nachos in cinemas and pouring your favorite cereal for breakfast only to have a drop of milk left. Just enough to wet bits of your cereals. Yeeeeargh!
When chasing bugs down the rabbit hole, we may arrive at the innards of code deep in some dark unchartered modules. Satisfied that this obscure line you’ve written half asleep in the wee hours is the source of your frustrations, you click the red debug breakpoint. Then start debug. Then Nothing. Nada. Nought. Zilch. Yeeeeargh!
Naturally, your IDE has no of idea your entry point. Open up launch.json in your .vscode/ directory and modify the configuration to statically point to your main entry point, whatever that may be.
That’s it. Your debug should start from where you currently are.
Update your launch.json configuration to be able to start debug from anywhere.
Wait, did I just write a medium because I’m too damn lazy to Google this every single time? Yup. Yes I did.