Skip to content

TUI debug panel: only 'local: args' is expandable; new variables created mid-session aren't #212

Description

@JDonaghy

Repro

  1. Start a debug session in TUI (`vimcode --tui`, F5).
  2. Step over the function entry (so DAP reports a local scope with multiple vars).
  3. In the variables tree, observe that `local: args` has an expand chevron and can be opened to show fields.
  4. Step over more lines that introduce additional locals (e.g. `let debug_log = ...`, `let skip_args = ...`).
  5. Try to expand any of the newly-created variables.

Expected: any aggregate / non-primitive variable should show an expand chevron and reveal child fields when activated.

Actual: newly-introduced variables show no chevron and don't expand. Only the original `args` variable is expandable across the entire session.

Suspected cause

Likely one of:

  • DAP `variablesReference` is non-zero only for the initially-requested variables; subsequent locals get returned without it.
  • Engine cache (`Engine::dap_variables`) is keyed on the first scope_id and not refreshed when new locals enter scope.
  • The lazy-load logic only fires for the row the user EXPANDED at session start; new rows have no expand state slot.

Files

  • `src/core/dap.rs` — DAP variable response parsing
  • `src/core/dap_manager.rs` — variable lazy-load + caching
  • `src/core/engine/dap_ops.rs` — `Engine::dap_variables`, scope/var management
  • `src/render.rs::build_var_tree` — render-side tree construction

Reference

Memory note (Session 95) mentions the build_var_tree includes group headers; possibly the chevron is only rendered for entries with non-empty children, and DAP's lazy-loaded variables show empty children until expanded.

Priority

Medium — debugging is much less useful when only one variable per session is inspectable.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions