Class: Byebug::DAP::Command::Variables
- Inherits:
-
Byebug::DAP::Command
- Object
- Byebug::DAP::Command
- Byebug::DAP::Command::Variables
- Includes:
- ValueHelpers
- Defined in:
- lib/byebug/dap/commands/variables.rb
Constant Summary
Constants inherited from Byebug::DAP::Command
Instance Method Summary collapse
Methods included from ValueHelpers
#prepare_value, #prepare_value_response
Methods inherited from Byebug::DAP::Command
command, execute, #execute_on_thread, #initialize, #log, register!, resolve!, #safe_execute, #started!, #stopped!
Methods included from SafeHelpers
Constructor Details
This class inherits a constructor from Byebug::DAP::Command
Instance Method Details
#execute ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/byebug/dap/commands/variables.rb', line 10 def execute started! thnum, frnum, named, indexed = resolve_variables_reference(args.variablesReference) case args.filter when 'named' indexed = [] when 'indexed' named = [] end vars = named + indexed first = args.start || 0 last = args.count ? first + args.count : vars.size last = vars.size unless last < vars.size variables = vars[first...last].map { |var, get| prepare_value_response(thnum, frnum, :variable, name: var) { get.call(var) } } respond! body: Protocol::VariablesResponseBody.new(variables: variables) end |