cider
cider copied to clipboard
Debugging and introspecting java code via dap-mode/lsp-java
I am working on a new package dap-mode
which is using Debug Adapter Protocol which currently supports debugging java. Here it is guide how it can be configured to debug java code when doing cider
repl session: debug java (Edited) . I believe that it may be usefull for clojure programmer who are doing java interoperability programming.
Additionally, if cider
provides information for the currenly executed line when the debugger is in clj source file it may be used to debug clojure source as well.
I am working on a new package dap-mode which is using Debug Adapter Protocol which currently supports debugging java. Here it is guide how it can be configured to debug java code when doing cider repl session: debug java . I believe that it may be usefull for clojure programmer who are doing java interoperability programming.
Looks cool! I guess we should mention this somewhere in the manual.
Additionally, if cider provides information for the currenly executed line when the debugger is in clj source file it may be used to debug clojure source as well.
What exactly do you need?
@bbatsov
What exactly do you need?
as it is partially visible in the screenshot above(in the Sessions window), there are no lines for clj files(it displays No Source). If cider provides a way to get the location in the clj file for particular stack frame then the debugger would be able to step through CLJ files as well.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contribution and understanding!
If cider provides a way to get the location in the clj file for particular stack frame then the debugger would be able to step through CLJ files as well.
That shouldn't be hard IMO. What should be the API for this?
@yyoncho This looks really cool. Do you still plan to work on this?
@jumarko yes, I am working on it, now it supports 10+ languages out of the box and it is part of emacs-lsp organization. Do you have something particular in mind?
@bbatsov I guess something like: (thread-name, stack-frame) -> (buffer-or-file-name, point)
would be sufficient to support stepping through.
Apart from that, I think that debugging clojurescript is possible even now via FF/Chrome debuggers which since they accept sourcemaps.
PS: I live in Sofia so we have a beer and chat about emacs and maintaining open source projects(I am now maintaining lsp-mode as well).
@bbatsov I guess something like: (thread-name, stack-frame) -> (buffer-or-file-name, point) would be sufficient to support stepping through.
Got it. @vspinu @Malabarba Would one of you be able to look into this?
PS: I live in Sofia so we have a beer and chat about emacs and maintaining open source projects(I am now maintaining lsp-mode as well).
Small world! I'd love to meet a fellow Bulgarian Emacser! Shoot me some email or something and we'll make it happen!
I would love to have a look at this but unfortunately I am really having hard time figuring lsp/lsp-java machinery for now, let alone dap-java. But it's probably my problem.
@yyoncho your original guide link is empty. Would be really great if you could provide a minimal setup for how a cider/clojure user could delve into dap. Thanks!
Here it is the proper link https://github.com/emacs-lsp/dap-mode/wiki/Clojure:-debugging-and-introspecting-Java-Code . I will create an emacs -q
configuration.
@yyoncho your original guide link is empty. Would be really great if you could provide a minimal setup for how a cider/clojure user could delve into dap. Thanks!
@vspinu is your issue sorted out now?
Yes, thanks. I have figured out the lsp part. Things do work as expected. Nice. Next is dap, but it might take a few weeks till I am able to dwell properly into it. I am in a traveling mode now.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contribution and understanding!
Bot, pls keep this open.
Hey, any news on this issue? it would be really cool to have this feature