Skip to content

feat(debugger): host word for the CLI frontend and bare-name hover values - #2354

Merged
caomengxuan666 merged 1 commit into
masterfrom
feat/debugger-host-name-hover
Oct 31, 2026
Merged

caomengxuan666 merged 1 commit into
masterfrom
feat/debugger-host-name-hover

Conversation

@caomengxuan666

@caomengxuan666 caomengxuan666 commented Oct 31, 2026 •

Copy link
Copy Markdown
Member

Summary

Two debugger-surface fixes found while exercising the Niubash host's --debug / --dap routes:

  • Host word in the CLI frontend. The interactive frontend derives the prompt/diagnostic word from the executable the host launched: niu presents (niu-dbg) / niu: --debug: …, while rubash, bash, and sh keep their own spellings. Unknown stems (test binaries, embedders) fall back to rubash, so existing transcripts stay stable. No public API or ledger change.
  • Bare-name hover values. A DAP hover/clipboard evaluate for a bare identifier now renders the variable from the stop snapshot (the same rendering as print and watch, arrays whole) instead of evaluating the literal word. VS Code hovers send the identifier without $, so the old result was the name itself.
  • Product help. rubash --help now lists --debug, --dap, and the spelled-out --debug --dap form. The bash/sh GNU faces stay byte-identical (the invocation-aware help gate still passes).

Tests

  • cargo test -p rubash --lib debugger:: — 162 passed, 2 ignored
  • cargo test -p rubash --test issue585_invocation_aware_help_regressions — 4 passed
  • rustfmt --check on every touched file

The companion Niubash PR (unixwin/niubash#754) documents the surface and consumes the derived host word.

- The interactive frontend derives its prompt and diagnostic word from
  the executable the host launched: `niu` presents `(niu-dbg)` /
  `niu: --debug: …`, while `rubash`, `bash`, and `sh` keep their own
  spellings. Unknown stems (test binaries, embedders) fall back to
  `rubash`, so existing transcripts stay stable. No public API or
  ledger change.
- DAP hover/clipboard evaluation of a bare identifier renders the
  variable from the stop snapshot (the same rendering as `print` and
  watch, arrays whole) instead of returning the literal word. The
  zero-JS VS Code hover sends the identifier without `$`, so it
  previously showed the name rather than the value.
- Product help advertises the native debugger faces (`--debug`,
  `--dap`, the spelled-out `--debug --dap` form); the bash/sh GNU
  faces stay byte-identical.
@caomengxuan666
caomengxuan666 force-pushed the feat/debugger-host-name-hover branch from b2bade0 to 76f611d Compare October 31, 2026 09:53
caomengxuan666 added a commit to unixwin/niubash that referenced this pull request Oct 31, 2026
- Surface the native debugger in `niu --help`: interactive
  `--debug <script>`, DAP `--dap <script>` (and the pure-server form),
  the spelled-out `--debug --dap` editor form, and GNU bashdb
  `--debugger`. The GNU long-option column is untouched, so the
  parser-table count gate still holds.
- The debugger frontend presents the host word `niu` — prompt
  `(niu-dbg)`, refusals `niu: --debug: …` — once the engine derives it
  from the executable (unixwin/rubash#2354); no host call site changes.
- Rewrite the "Script Debugging Flags" docs for the native debugger,
  keep the legacy extdebug-arming note for `-c`/`-s`/`-i`, and add the
  same short reference to the agent skill.
- Add the zero-JS VS Code extension manifest for Niubash (`type`
  `niubash`, `program` `niu`, args `--debug --dap`) plus its README.
- Add a host-wiring smoke test that drives `niu --dap` over Content-
  Length framed DAP on stdio and checks the manifest identity, and a
  help gate for the debugger lines.
@caomengxuan666
caomengxuan666 merged commit 89e8550 into master Oct 31, 2026
11 checks passed
@caomengxuan666
caomengxuan666 deleted the feat/debugger-host-name-hover branch November 2, 2026 01:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant