Visual Studio Code breakpoint appearing in wrong place

To answer this for any particular case, one would need the launch.json configuration being used, and the source folder structure, at minimum. I have a true story from just last week to illustrate why: Background I recently inherited a relatively small Vue project, and immediately encountered the same problem. Breakpoints in VSCode were “jumpy” in … Read more

How to step through suspend function calls when debugging Kotlin coroutines

This page shows some general techniques. In short, run with enabled assertions (-ea JVM flag). kotlinx-coroutines-debug module is specifically designed for what its name says. This is how I use it in unit tests; runBlocking { DebugProbes.install() val deferred = async { methodUnderTest() } delay(3000) DebugProbes.dumpCoroutines() println(“\nDumping only deferred”) DebugProbes.printJob(deferred) DebugProbes.uninstall() cleanup() } There’s a … Read more