File tree Expand file tree Collapse file tree 1 file changed +29
-8
lines changed Expand file tree Collapse file tree 1 file changed +29
-8
lines changed Original file line number Diff line number Diff line change 44
44
45
45
(defun dap-firefox--populate-start-file-args (conf )
46
46
" 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 (expand-file-name (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
+ (dap--plist-delete
52
+ (pcase (plist-get conf :mode )
53
+ (" url" (-> conf
54
+ (dap--put-if-absent :url (read-string
55
+ " Browse url: "
56
+ " http://localhost:5371" t ))
57
+ (dap--put-if-absent :webRoot (lsp-workspace-root))))
58
+ (" file" (dap--put-if-absent conf :file
59
+ (read-file-name " Select the file to open in the browser:" nil (buffer-file-name ) t )))
60
+ (_ conf))
61
+ :mode ))
53
62
54
63
(dap-register-debug-provider " firefox" 'dap-firefox--populate-start-file-args )
55
64
56
- (dap-register-debug-template " Firefox Run Configuration "
65
+ (dap-register-debug-template " Firefox Browse File "
57
66
(list :type " firefox"
67
+ :mode " file"
58
68
:cwd nil
59
69
:request " launch"
60
70
:file nil
71
+ :reattach t
72
+ :program nil
73
+ :name " Firefox Browse File" ))
74
+
75
+ (dap-register-debug-template " Firefox Browse URL"
76
+ (list :type " firefox"
77
+ :mode " url"
78
+ :cwd nil
79
+ :request " launch"
80
+ :webRoot nil
81
+ :url nil
61
82
:reAttach t
62
83
:program nil
63
- :name " Firefox::Run " ))
84
+ :name " Firefox Browse URL " ))
64
85
65
86
(provide 'dap-firefox )
66
87
; ;; dap-firefox.el ends here
You can’t perform that action at this time.
0 commit comments