File tree Expand file tree Collapse file tree 1 file changed +31
-8
lines changed
Expand file tree Collapse file tree 1 file changed +31
-8
lines changed Original file line number Diff line number Diff line change 4444
4545(defun dap-firefox--populate-start-file-args (conf )
4646 " Populate CONF with the required arguments."
47- (-> conf
48- (dap--put-if-absent :dap-server-path dap-firefox-debug-program)
49- (dap--put-if-absent :type " Firefox" )
50- (dap--put-if-absent :cwd default-directory)
51- (dap--put-if-absent :file (read-file-name " Select the file to open in the browser:" nil (buffer-file-name ) t ))
52- (dap--put-if-absent :name " Firefox Debug" )))
47+ (setq conf (-> conf
48+ (plist-put :type " firefox" )
49+ (plist-put :dap-server-path dap-firefox-debug-program)
50+ (dap--put-if-absent :cwd (expand-file-name default-directory))))
51+
52+ (dap--plist-delete
53+ (pcase (plist-get conf :mode )
54+ (" url" (-> conf
55+ (dap--put-if-absent :url (read-string
56+ " Browse url: "
57+ " http://localhost:5371" t ))
58+ (dap--put-if-absent :webRoot (lsp-workspace-root))))
59+
60+ (" file" (dap--put-if-absent conf :file
61+ (read-file-name " Select the file to open in the browser:" nil (buffer-file-name ) t )))
62+ (_ conf))
63+ :mode ))
5364
5465(dap-register-debug-provider " firefox" 'dap-firefox--populate-start-file-args )
5566
56- (dap-register-debug-template " Firefox Run Configuration "
67+ (dap-register-debug-template " Firefox Browse File "
5768 (list :type " firefox"
69+ :mode " file"
5870 :cwd nil
5971 :request " launch"
6072 :file nil
6173 :reAttach t
74+ :program nil
75+ :name " Firefox Browse File" ))
76+
77+ (dap-register-debug-template " Firefox Browse URL"
78+ (list :type " firefox"
79+ :mode " url"
80+ :cwd nil
81+ :request " launch"
82+ :webRoot nil
83+ :url nil
84+ :reAttach t
6285 :program nil
63- :name " Firefox::Run " ))
86+ :name " Firefox Browse URL " ))
6487
6588(provide 'dap-firefox )
6689; ;; dap-firefox.el ends here
You can’t perform that action at this time.
0 commit comments