# A little problem of debugging via VScode

**URL:** <https://forums.sketchup.com/t/a-little-problem-of-debugging-via-vscode/159050>\
**Category:** Ruby API\
**Created:** [March 31, 2021, 9:07am UTC](https://forums.sketchup.com/t/a-little-problem-of-debugging-via-vscode/159050 "2021-03-31T09:07:49Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jason190](https://avatars.discourse-cdn.com/v4/letter/j/dbc845/32.png) [@jason190](https://forums.sketchup.com/u/jason190)\
**Post date:** [March 31, 2021, 9:07am UTC](https://forums.sketchup.com/t/a-little-problem-of-debugging-via-vscode/159050/1 "2021-03-31T09:07:49Z")

</div>

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?

 ![image](https://global.discourse-cdn.com/sketchup/original/3X/8/7/87a54afc5d4c9f79f6a5fef2155793a3339f0360.png)  
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.

---

<div class="post-metadata">

**Author:** ![Neil\_Burkholder](https://avatars.discourse-cdn.com/v4/letter/n/f4b2a3/32.png) [@Neil\_Burkholder](https://forums.sketchup.com/u/Neil_Burkholder)\
**Post date:** [March 31, 2021, 2:14pm UTC](https://forums.sketchup.com/t/a-little-problem-of-debugging-via-vscode/159050/2 "2021-03-31T14:14:14Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jason190](https://avatars.discourse-cdn.com/v4/letter/j/dbc845/32.png) [@jason190](https://forums.sketchup.com/u/jason190)\
**Post date:** [April 1, 2021, 12:59am UTC](https://forums.sketchup.com/t/a-little-problem-of-debugging-via-vscode/159050/3 "2021-04-01T00:59:15Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![kengey](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/kengey/32/234545_2.png) [@kengey](https://forums.sketchup.com/u/kengey)\
**Post date:** [April 1, 2021, 6:51am UTC](https://forums.sketchup.com/t/a-little-problem-of-debugging-via-vscode/159050/4 "2021-04-01T06:51:07Z")

</div>

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]`

---

<div class="post-metadata">

**Author:** ![jason190](https://avatars.discourse-cdn.com/v4/letter/j/dbc845/32.png) [@jason190](https://forums.sketchup.com/u/jason190)\
**Post date:** [April 8, 2021, 7:43am UTC](https://forums.sketchup.com/t/a-little-problem-of-debugging-via-vscode/159050/5 "2021-04-08T07:43:29Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![tks](https://avatars.discourse-cdn.com/v4/letter/t/e99b99/32.png) [@tks](https://forums.sketchup.com/u/tks)\
**Post date:** [October 17, 2023, 11:40am UTC](https://forums.sketchup.com/t/a-little-problem-of-debugging-via-vscode/159050/6 "2023-10-17T11:40:25Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![slbaumgartner](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/slbaumgartner/32/7302_2.png) [@slbaumgartner](https://forums.sketchup.com/u/slbaumgartner)\
**Post date:** [October 17, 2023, 1:13pm UTC](https://forums.sketchup.com/t/a-little-problem-of-debugging-via-vscode/159050/7 "2023-10-17T13:13:40Z")

</div>

Instructions at [GitHub - SketchUp/sketchup-ruby-debugger: Ruby API debugger for SketchUp 2014 and later.](https://github.com/SketchUp/sketchup-ruby-debugger)
