Compare commits

..

2 Commits

2 changed files with 24 additions and 21 deletions

View File

@ -52,20 +52,28 @@
`(html-web-mode . ,(eglot-alternatives
'(("vscode-html-language-server" "--stdio")
("html-languageserver" "--stdio")))))
(defvar eglot-java-java-agent nil
"Java agent JVM arg for eglot JDTLS.")
;; Custom eglot java server for deeper customization
(defclass eglot-java-server (eglot-lsp-server) ()
:documentation "Eglot integration with JDTLS.")
(add-to-list 'eglot-server-programs
'(java-mode .
(eglot-java-server .
("jdtls" :initializationOptions
(:extendedClientCapabilities
(:classFileContentsSupport t)
:runtimes [(:name "JavaSE-11"
(defun eglot-java-contact (&optional interactive)
`(eglot-java-server .
("jdtls" ,(if (s-blank? eglot-java-java-agent)
""
(format "--jvm-arg=-javaagent:%s" eglot-java-java-agent))
:initializationOptions
(:extendedClientCapabilities (:classFileContentsSupport t)
:settings
(:java
(:home "/Library/Java/JavaVirtualMachines/amazon-corretto-17.jdk/Contents/Home"
:configuration
(:runtimes [(:name "JavaSE-11"
:path "/Library/Java/JavaVirtualMachines/amazon-corretto-11.jdk")
(:name "JavaSE-17"
:path "/Library/Java/JavaVirtualMachines/amazon-corretto-17.jdk"
:default t)])))))
:default t)])))))))
(add-to-list 'eglot-server-programs '(java-mode . eglot-java-contact))
;; Fix JDTLS's weird handling of workspaceEdit
(cl-defmethod eglot-execute-command
((_server eglot-java-server) (_cmd (eql java.apply.workspaceEdit)) arguments)

View File

@ -30,23 +30,18 @@
deferred:timeout
deferred:process))
(use-package s
:defer t)
(use-package s)
(use-package dash
:defer t)
(use-package dash)
(use-package dash-functional
:defer t)
(use-package dash-functional)
(use-package f
:defer t)
(use-package f)
(use-package request
:commands request)
(use-package ht
:defer t)
(use-package ht)
;; Elisp utilities
(defun make-process-sentinel (success err)