2024-02-11 01:17:54 +01:00
|
|
|
:PROPERTIES:
|
|
|
|
:header-args:emacs-lisp: :comments link :results none
|
|
|
|
:ID: 48638197-4f3b-4cd5-ad09-ffc014809fd5
|
|
|
|
:END:
|
|
|
|
#+title: Java
|
|
|
|
#+filetags: emacs-load
|
|
|
|
|
|
|
|
#+begin_src emacs-lisp
|
|
|
|
(use-package lsp-java
|
|
|
|
:straight t
|
|
|
|
:config
|
|
|
|
(defun lsp-envrc-mode-setup ()
|
|
|
|
(when
|
|
|
|
(or (equal major-mode 'java-mode) (equal major-mode 'java-ts-mode))
|
|
|
|
(setq lsp-java-server-install-dir
|
|
|
|
(concat (getenv "JDTLS_PATH") "/share/java/"))))
|
|
|
|
(defun lsp-java ())
|
|
|
|
(defun lsp-java--ls-command ()
|
|
|
|
(message (concat (getenv "JDTLS_PATH") "/share/java/"))
|
|
|
|
(list (concat (getenv "JDTLS_PATH") "/bin/jdt-language-server")
|
|
|
|
"-configuration" (concat (getenv "HOME") "/.jdtls/config_linux")
|
|
|
|
"-data" (concat (getenv "HOME") "/.jdtls/java-workspace")))
|
2024-03-23 08:31:48 +01:00
|
|
|
:mode ("\\.java\\'" . java-ts-mode)
|
2024-02-11 01:17:54 +01:00
|
|
|
:hook ((envrc-mode . lsp-envrc-mode-setup)
|
|
|
|
(java-ts-mode . lsp-deferred)))
|
|
|
|
#+end_src
|