Skip to content

Add compact variable previews in scope and watch buffers - #307

Open
iamziad wants to merge 1 commit into
svaante:masterfrom
iamziad:improve
Open

iamziad wants to merge 1 commit into
svaante:masterfrom
iamziad:improve

Conversation

@iamziad

@iamziad iamziad commented Sep 20, 2026

Copy link
Copy Markdown

Adapters like js-debug send the whole preview of an object as one very
long line, which makes the scope/watch buffers hard to read.

This shows a short placeholder for compound variables instead
("Server {_events: {...}, ...}" -> "Server {…}") and truncates long
scalars, with the full value in the tooltip. Expanding a variable
still shows every child. Display only, REPL and eldoc are untouched.

Two new options (both can be set to nil):
dape-info-variable-value-max-length and dape-info-scalar-value-max-length.

Tests added (dape-test-info-variable-*). (All passed)

Note: this overlaps a bit with dape-info-variable-table-row-config.

* dape.el (dape-info-variable-value-max-length)
(dape-info-scalar-value-max-length, dape-variable-placeholder-face):
New options and face.
(dape--info-variable-placeholder, dape--info-variable-compact)
(dape--info-variable-compact-context-p): New functions.
(dape--info-scope-add-variable): Use them.
* dape-tests.el (dape-test-info-variable-*): New tests.
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