svaante / dape

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

vscode-js-debug: Breakpoints don't sync between chrome and emacs #157

Open JordanAnthonyKing opened 1 week ago

JordanAnthonyKing commented 1 week ago

After configuring dape for my specific setup I'm finding the following behavior. Any breakpoints set in emacs are not hit in chrome, and do not show up in the chrome devtools. Breakpoints set in chrome do not show in emacs but if chrome hits one of these breakpoints it will show in emacs (line flash, execution pause, stack etc.).

Is there any way I can debug this further or is it a missing feature?

Here's my config for reference:

(use-package dape
  :hook
  ((kill-emacs . dape-breakpoint-save) (after-init . dape-breakpoint-load))

  :config
  (setq dape-buffer-window-arrangement 'right)
  (add-hook 'dape-display-source-hook 'pulse-momentary-highlight-one-line)
  (add-hook 'dape-stopped-hook 'dape-info)
  (add-hook 'dape-stopped-hook 'dape-repl)

  (add-to-list 'dape-configs
               `(angular
                 modes (typescript-mode typescript-ts-mode angular-ts-mode)
                 command "node"
                 port 9222
                 command-cwd ,(concat user-emacs-directory "debug-adapters/js-debug")

                 command-args (,(concat user-emacs-directory "debug-adapters/js-debug/src/dapDebugServer.js") "9222")

                 :name "DEBUG"
         :type "pwa-chrome"
                 :request "attach"
                 :port 9222
                 :webRoot ,(lambda ()
                             (read-string "Root: "
                                          (funcall dape-cwd-fn))))))

Looking through related work in neovim seems like this might be a known issue: https://github.com/mxsdev/nvim-dap-vscode-js?tab=readme-ov-file#user-content-fn-1-6f8019b7cc7261527d6457938e42b16c

JordanAnthonyKing commented 1 week ago

@minikN

svaante commented 6 days ago

Is this something that is advertised to work? It doesn't work in visual studio code and the js-debug does not send any breakpoints information when setting an breakpoints in chrome (at least for the the version I am using).

AFAICT this is not an feature that is supported by js-debug.