Recompile as deep as you need with debug info on, preferably also with optimizations off. Although I feel like these days the debug info is smart enough to consider optimizations into account as well, but since you're stepping at source level which might be erased / modified by optimizations, you might feel weird if the highlight skips certain lines. AFAIK RTL/FCL must be recompiled outside the IDE, as it only has direct access to LCL.