New Debugger and Custom Classes

I noticed today that my MakeCode Arcade upgraded to version 0.8.11! I also noticed that the debugger is no longer an experiment. It’s been officially integrated into the release!

I’ve used the experimental debugger quite a bit as I created my projects, and I enjoyed using it. The integrated version looks wonderful! I noticed you’re able to dig into an object’s state (e.g. sprites), which was something you could not do with the experimental debugger. Great feature!

I noticed, too, that I could not dig into objects made from my custom classes (e.g. those created by custom extensions). Is there some syntactic sugar that we need to add to those custom classes so that the debugger can show state information for objects created from them? Or will that be taken care of in a later version?

P.S. I’ve been meaning to run the latest branch (currently version 0.9.x) locally. If this has already been addressed in a more recent release, my apologies in advance for my ignorance.


Could you post/link your classes? User code should also work but there are a few caveats

1 Like

Thanks, @richard! I was playing around with the debugger in Acey Deucey. I noticed that the objects created from classes in my custom extension were not showing state. (I created a breakpoint in the drawCard() function.)

Sorry for the delay, looks like you’re using getters in your card extension so you’ll need to add callInDebugger to the comment annotation for each getter. We only invoke getters that have that annotation because getters can have side effects (even though it’s bad practice) and our runtime does not currently have the ability to prevent those side effects from happening.

1 Like

Brilliant! Thanks, @richard! I’ve updated my playing cards extension with the comment annotation where appropriate. Seems to be working quite well. I’ll remember that for future extensions.