ruby / debug

Debugging functionality for Ruby
BSD 2-Clause "Simplified" License
1.14k stars 127 forks source link

DAP: add the ability to hide the #class item for each object #986

Closed ono-max closed 1 year ago

ono-max commented 1 year ago

We can hide the #class item for each object by setting true in hideClassItem.

Closes https://github.com/ruby/vscode-rdbg/issues/37.

Before

Screen Shot 2023-06-03 at 13 34 01

After

Screen Shot 2023-06-03 at 13 33 26
amomchilov commented 1 year ago

Perhaps there should be a special case for the most common values like:

So you can have #class when it's useless, but not have it spam for all "scalar" values

amomchilov commented 1 year ago

I implemented this in https://github.com/ruby/debug/pull/1004/files, with a few improvements:

  1. Because of the improvements in #1001, the implementation applies to both DAP and CDP.
  2. The bug fixes in #1001 make the counts correct, so you don't see the disclosure triangles for items that have no members. (e.g. ⋁ a: 1 will now just be a: 1)
  3. It still keeps #class when it helps.

I would love to hear your feedback!

ko1 commented 1 year ago

discuss on #1004 !