svaante / dape

Debug Adapter Protocol for Emacs
GNU General Public License v3.0
455 stars 25 forks source link

Enhancing dape REPL to Display Object Properties #59

Closed domas-v closed 7 months ago

domas-v commented 7 months ago

Hi! Thank you for this package. It has significantly improved my workflow, which led me to use Emacs almost exclusively, transitioning from VS Code.

Background:

In both VS Code and Neovim (using DAP), the debugger's REPL provides an interactive way to inspect objects. It displays the properties of objects when they are printed, as shown in the screenshot below from VS Code:

image

Issue:

In contrast, when working with dape, the REPL only outputs either the string representation of objects or the object is not printed at all, hence inspection is not possible. Here is an example of how it currently looks in dape:

image

As a workaround, I've been using the watch window for object inspection. While this workaround is functional, having the capability directly in the REPL would help reduce the need for additional windows beyond the source code and REPL itself in many cases.

Question:

Is there a possibility to enhance the dape REPL to mirror the object inspection feature found in VS Code/Neovim DAP? If so, could you provide guidance on how one might contribute to or implement this feature?

svaante commented 7 months ago

Looks interesting and useful, if you are interested in implementing this I would suggest that you start the process of FSF copyright assignment as this is required for elpa packages see https://www.fsf.org/licensing/contributor-faq.

I will gladly offer guidance!

domas-v commented 7 months ago

Thanks. I will look into this. I would like some pointers on where to start, though I am a noob at elisp

svaante commented 7 months ago

Sorry for taking the task away from you, as I was digging deeper in what would be required to add this feature I realized that collecting enough information for you to get started was as much work as getting it done.

And for no printing on "p" that's expected as "p" is the shorthand for pause. If you want to remove this behavior you can (setq dape-repl-use-shorthand nil)or remove commands you are uninterested in the dape-repl-commandsoption.

However a simpler way is to type p (space at the end) which will then bypass the repl commands and evaluate the var p

Anyhow please checkout dape on master and see if you like the result

domas-v commented 7 months ago

Amazing. Works like a charm. Thanks a lot. 🙏🏻