dotfiles/emacs/.emacs.d/config/init-java.el

38 lines
1.2 KiB
EmacsLisp
Raw Normal View History

2022-03-30 16:26:58 +00:00
;; -*- lexical-binding: t; -*-
;; Default to the Google styleguide formatting for Java
(use-package google-c-style
:hook (java-mode . google-set-c-style))
2022-03-30 16:26:58 +00:00
(use-package lsp-java
:custom
(lsp-java-maven-download-sources t)
(lsp-java-configuration-runtimes '[(:name "JavaSE-11"
:path "/Library/Java/JavaVirtualMachines/amazon-corretto-11.jdk"
:default t)
(:name "JavaSE-17"
:path "/Library/Java/JavaVirtualMachines/amazon-corretto-17.jdk")]))
2022-03-30 16:26:58 +00:00
2022-04-20 19:53:36 +00:00
(defvar java-debug-map (make-sparse-keymap))
(general-def java-mode-map
"C-c d" '(:keymap java-debug-map :which-key "debug"))
(general-def java-debug-map
"d" 'dap-java-debug
"t" 'dap-java-debug-test-method
"c" 'dap-java-debug-test-class
"b" 'dap-breakpoint-toggle)
2022-04-20 19:53:36 +00:00
(with-eval-after-load 'dap-java
(setq dap-java-test-additional-args '("-n" "\".*(Test|IT).*\"")))
(defun jdormit-java-setup ()
(lsp-deferred)
2022-04-20 19:53:36 +00:00
(require 'dap-java)
(dap-mode))
(add-hook 'java-mode-hook 'jdormit-java-setup)
2022-04-01 14:25:51 +00:00
(use-package protobuf-mode)
2022-03-30 16:26:58 +00:00
(provide 'init-java)