debug icon indicating copy to clipboard operation
debug copied to clipboard

Inspect numbered params or the default block param

Open eric1234 opened this issue 11 months ago • 1 comments

Sorry if this is the wrong place to ask this. I've searched the web, asked AI, asked on a few Ruby forums and searched the issues on this repo.

The numbered block params (_1, _2, ...) and the new default block param (it) cannot be inspected in the debugger. I've tried various things such as:

  • Using eval - eval('it')
  • Inspecting binding
  • Assigning to a value at the debugger prompt (v = it)

Nothing seems to work. I generally have to update the code to use traditional named block args which is sort of annoying and makes me not want to use it even though I otherwise love it.

Am I missing something or is this just a current deficiency in the debugger?

eric1234 avatar Jan 30 '25 02:01 eric1234

Thank you for your report.

it is recently introduced new feature and we can't use it in eval. It means that you can not use it in the prompt, like p it.upcase. To enable it, we need to introduce some new features in Ruby to access it on the current context.

I understand the motivation and I left this issue.

ko1 avatar Jun 04 '25 06:06 ko1