-
Notifications
You must be signed in to change notification settings - Fork 183
/
dap-ocaml.el
50 lines (37 loc) · 1.77 KB
/
dap-ocaml.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
;;; dap-mode/dap-ocaml.el -*- lexical-binding: t; -*-
;; Copyright (C) 2018 Austin Theriault
;; Author: Austin Theriault <[email protected]>
;; Keywords: languages
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <https://www.gnu.org/licenses/>.
;;; Commentary:
;; Adapter for OCaml Earlybird (https://github.com/hackwaly/ocamlearlybird)
;;; Code:
(require 'dap-mode)
(defcustom dap-ocaml-executable "ocamlearlybird"
"Path to the OCaml Earlybird executable."
:group 'dap-ocaml
:risky t
:type 'file)
(defun dap-ocaml--populate-start-file-args (conf)
"Populate CONF with the start file argument."
(-> conf
(dap--put-if-absent :console "internalConsole") ;; integratedTerminal doesn't work
(dap--put-if-absent :dap-server-path (list dap-ocaml-executable "debug"))))
(dap-register-debug-provider "ocaml.earlybird" 'dap-ocaml--populate-start-file-args)
(dap-register-debug-template "OCaml Debug Template"
(list :type "ocaml.earlybird"
:request "launch"
:name "OCaml::Run"
:program nil
:arguments nil))
(provide 'dap-ocaml)
;;; dap-ocaml.el ends here