Uh oh!
There was an error while loading. Please reload this page.
DAP: introduce Rdbg Trace Inspector - #916
Conversation
I've been wanting this feature for a while, this looks super cool 🎉 |
ono-max
commented
Mar 6, 2023
We can select the option as follows: Screen.Recording.2023-02-27.at.18.03.30.mov |
ono-max
commented
Mar 6, 2023
Yeah, I think that we can add tests. |
| end | ||
| class MultiTracer < Tracer | ||
| MAX_LENGTH = 4000 |
| end | ||
| end | ||
| class MultiTracer < Tracer |
| @tracer = TracePoint.new(*@evts){|tp| | ||
| next if skip?(tp) | ||
| call_identifier_str = |
| when 'return' | ||
| evts << :return | ||
| evts << :c_return | ||
| evts << :b_return |
There was a problem hiding this comment.
else
raise "unknown trace type #{evt}"
| when 'enable' | ||
| events = req.dig('arguments', 'events') | ||
| evts = [] | ||
| events.each{|evt| |
There was a problem hiding this comment.
Another idea:
EVENTS={'line'=>[:line], ...}def ...evts=[]events.each{|evt| evts.concatEVENTS[evt]}
...or
evts=events.flat_map{|evt| EVENTS[evt]}But the current code makes sense because it is easy to read.
| end | ||
| } | ||
| @ui.respond req, {} | ||
| when 'logs' |
There was a problem hiding this comment.
other subcommands are verbs so I recommend to use collect (a verb word)
d198e27 to
6d9078dComparest0012
commented
Mar 9, 2023
@ono-max Thanks. Could we first have some tests in the same PR? |
I'll try it, but I'm not sure if I can add tests in the same PR because I'm busy right now. There is a possibility they are added in the other PR. Sorry. |
af8d49f to
35bab9dCompare
We'll introduce a new feature Rdbg Trace Inspector. This is useful when tracing in VS Code.
Untitled.Project.4.-.HD.1080p.mov
How to use it
That's it! You can check the location and returned value by clicking the trace log.
How to choose events
On the default, line, call, and return events are selected.
If you want to change the default, click "more items", then choose events in the context menu.
Screen.Recording.2023-02-27.at.18.03.30.mov