A little problem of debugging via VScode

The debug function is fine. But the current line is not highlighted. what’s more, when I point to the variable name, there are no current value popup.
Is it any settings I have overwritten?


note the 18 line doesn’t highlighted.

By the way, the debug function is only worked in 2021. It won’t work in 2020, I’m confusing why.

I had that problem if there were rbs or rbe files in the extension. Initially the encrypted file would load, then when reloading from the unencrypted source file the debugger still got confused.

Hi, Neil
you can see the file extension is .rb at top. I even don’t know the format rbs/rbe. Are they binaries?

Are you trying to debug this to see why comp is not an array any more after your code runs? That is because you are assigning the entity to comp, instead of adding it to the array, so in the end comp will be the last entity of the selection.

Try to push it to the array.

Or, if you are really just interested in the last selected entity, you can do comp = selection[-1]

Nope, I just try to setup a debug environment. But your reply is useful for me as well. Thank you.

Hi @jason190
Can you please tell me how can I debug a ruby code for SketchUp. I’ve just started working on SketchUp and I’m not getting how to debug anything I write. If you can guide me how can I debug the code, that will be a great help.

Instructions at GitHub - SketchUp/sketchup-ruby-debugger: Ruby API debugger for SketchUp 2014 and later.

1 Like