Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions dap-kotlin.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
;; Commentary:
;; Adapter for https://github.com/fwcd/kotlin-debug-adapter

(require 'lsp-kotlin)
(require 'dap-mode)

(defun dap-kotlin-populate-launch-args (conf)
;; we require mainClass and projectRoot to be filled in in the launch configuration.
;; dap-kotlin does currently not support a fallback if not defined
(-> conf
(dap--put-if-absent :request "launch")
(dap--put-if-absent :name "Kotlin Launch")))

(defun dap-kotlin-populate-default-args (conf)
(setq conf (pcase (plist-get conf :request)
("launch" (dap-kotlin-populate-launch-args conf))
(_ (error "Unsupported dap-request. Only launch is currently supported"))))

(-> conf
(dap--put-if-absent :type "kotlin")
(plist-put :dap-server-path (list lsp-kotlin-debug-adapter-path))))

(dap-register-debug-provider "kotlin" #'dap-kotlin-populate-default-args)

(provide 'dap-kotlin)