|
| 1 | +;;; dap-erlang.el --- Debug Adapter Protocol mode for Erlang -*- lexical-binding: t; -*- |
| 2 | + |
| 3 | +;; Copyright (C) 2018 Ivan Yonchovski |
| 4 | + |
| 5 | +;; Author: Ivan Yonchovski <[email protected]> |
| 6 | +;; Keywords: languages |
| 7 | + |
| 8 | +;; This program is free software; you can redistribute it and/or modify |
| 9 | +;; it under the terms of the GNU General Public License as published by |
| 10 | +;; the Free Software Foundation, either version 3 of the License, or |
| 11 | +;; (at your option) any later version. |
| 12 | + |
| 13 | +;; This program is distributed in the hope that it will be useful, |
| 14 | +;; but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | +;; GNU General Public License for more details. |
| 17 | + |
| 18 | +;; You should have received a copy of the GNU General Public License |
| 19 | +;; along with this program. If not, see <https://www.gnu.org/licenses/>. |
| 20 | + |
| 21 | +;; URL: https://github.com/yyoncho/dap-mode |
| 22 | +;; Package-Requires: ((emacs "25.1") (dash "2.14.1") (lsp-mode "4.0")) |
| 23 | +;; Version: 0.2 |
| 24 | + |
| 25 | +;;; Commentary: |
| 26 | +;; Adapter for https://github.com/erlang-ls/erlang_ls |
| 27 | +;; Created by Roberto Aloi (@robertoaloi) |
| 28 | + |
| 29 | +;;; Code: |
| 30 | + |
| 31 | +(require 'dap-mode) |
| 32 | + |
| 33 | +(defun dap-erlang--populate-start-file-args (conf) |
| 34 | + "Populate CONF with the required arguments." |
| 35 | + (-> conf |
| 36 | + (plist-put :dap-server-path '("els_dap")) |
| 37 | + (plist-put :projectDir (lsp-find-session-folder (lsp-session) (buffer-file-name))) |
| 38 | + (plist-put :cwd (lsp-find-session-folder (lsp-session) (buffer-file-name))) |
| 39 | + )) |
| 40 | +(dap-register-debug-provider "erlang" 'dap-erlang--populate-start-file-args) |
| 41 | + |
| 42 | +(provide 'dap-erlang) |
| 43 | +;;; dap-erlang.el ends here |
0 commit comments