Skip to content

Commit

Permalink
feat(debugger): use dap-js instead of legacy debug adapters
Browse files Browse the repository at this point in the history
The debug adapters powering [`dap-node`][vscode-node-debug], [`dap-chrome`][vscode-chrome-debug], and [`dap-edge`][vscode-edge-debug2] have all been deprecated and unmaintained for a while in favour of [`vscode-js-debug`][vscode-js-debug].

`dap-mode` has [added support for `vscode-js-debug`][pr], via `dap-js`.

[vscode-node-debug]: https://github.com/microsoft/vscode-node-debug
[vscode-chrome-debug]: https://github.com/Microsoft/vscode-chrome-debug
[vscode-edge-debug2]: https://github.com/microsoft/vscode-edge-debug2
[vscode-js-debug]: emacs-lsp/dap-mode#733
[pr]: emacs-lsp/dap-mode#369
  • Loading branch information
zeorin committed Apr 22, 2024
1 parent 9620bb4 commit 9bad287
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion modules/tools/debugger/config.el
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
((:lang rust +lsp) :after rustic-mode :require (dap-lldb dap-cpptools))
((:lang javascript +lsp)
:after (js2-mode typescript-mode)
:require (dap-node dap-chrome dap-firefox ,@(if (featurep :system 'windows) '(dap-edge)))))
:require (dap-js dap-firefox)))
"TODO")


Expand Down Expand Up @@ -115,6 +115,14 @@
(setq dap-breakpoints-file (concat doom-data-dir "dap-breakpoints")
dap-utils-extension-path (concat doom-data-dir "dap-extension/"))
(after! lsp-mode (require 'dap-mode))
(after! dap-js
(dap-register-debug-provider "node" #'dap-js--populate-start-file-args)
(dap-register-debug-provider "node-terminal" #'dap-js--populate-start-file-args)
(dap-register-debug-provider "chrome" #'dap-js--populate-start-file-args)
(dap-register-debug-provider "msedge" #'dap-js--populate-start-file-args)
(dap-register-debug-provider "pwa-node" #'dap-js--populate-start-file-args)
(dap-register-debug-provider "pwa-chrome" #'dap-js--populate-start-file-args)
(dap-register-debug-provider "pwa-msedge" #'dap-js--populate-start-file-args))
:config
(pcase-dolist (`((,category . ,modules) :after ,after :require ,libs)
+debugger--dap-alist)
Expand Down

0 comments on commit 9bad287

Please sign in to comment.