spacemacs icon indicating copy to clipboard operation
spacemacs copied to clipboard

[clojure] README: add support for ClojureScript stepper via LSP-mode and DAP-mode

Open allentiak opened this issue 2 years ago • 4 comments

It would be nice to have an option in the clojure layer to automatically setup a ClojureScript stepper via DAP and LSP.

The instructions from [1] are declared as valid for vanilla Emacs. However, they need to be adapted for Spacemacs.

(I tried making it work by installing the dap layer, but couldn't make it work due to a lack of specific Spacemacs/Emacs knowledge. You may find my current ~/.spacemacs.d/init.el in [2].)

[1] https://emacs-lsp.github.io/lsp-mode/tutorials/debugging-clojure-script/ [2] https://github.com/allentiak/.spacemacs.d/blob/46df5678aa0918b5105b013089f6ddf235d7e5fe/init.el

Relevant Message from the Clojurians Zulip: https://clojurians.zulipchat.com/#narrow/stream/151763-beginners/topic/spacemacs.20.2B.20clojurescript.20.2B.20debugging.20.3F/near/281212390

Related issue from dap-mode: https://github.com/emacs-lsp/dap-mode/issues/554#issuecomment-1118456198

allentiak avatar May 27 '22 01:05 allentiak

UPDATE: I have made dap-debug work for ClojureScript:

Mini-HOWTO: Spacemacs DAP Debugging for ClojureScrip

  • Add the dap layer to the dotspacemacs/layers () section of your .spacemacs file (at the top of the file).
  • Require the corresponding module in the dotspacemacs/user-config () section of your .spacemacs (at the bottom of the file). (In my case, I made it work with Chromium.)
  • Make sure the Chromium executable is correctly setup (see https://github.com/syl20bnr/spacemacs/issues/13614#issuecomment-1179478365)
dotspacemacs/user-config()
  ...
  ;; Enable DAP debugging in ClojureScript.
  ;; Trying almost all options...

  ;; This one downloads OK.
  (require 'dap-chrome)

  ;; These two cannot be downloaded... 
  ;; (require 'dap-firefox)
  ;; (require 'dap-node)

  ;; I'm not into trying this one...
  ;; (require 'dap-edge)

Based on: https://emacs-lsp.github.io/lsp-mode/tutorials/debugging-clojure-script/

allentiak avatar Jul 09 '22 04:07 allentiak

Feel free to make this a wiki page.

lebensterben avatar Jul 13 '22 04:07 lebensterben

Should this be added to the Clojure layer documentation page?

allentiak avatar Jul 13 '22 12:07 allentiak

@allentiak Yes.

lebensterben avatar Jul 13 '22 19:07 lebensterben

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please let us know if this issue is still valid!

github-actions[bot] avatar Jul 21 '23 12:07 github-actions[bot]