Skip to content

Configuring eglot with Eclipse jdtls #888

Answered by zsxh
hjudt asked this question in Q&A
Mar 17, 2022 · 8 comments · 4 replies
Discussion options

You must be logged in to vote

check eglot-initialization-options.

for example:

(defvar +eglot/initialization-options-map (make-hash-table :size 5))

(cl-defmethod eglot-initialization-options ((server eglot-lsp-server))
    (if-let ((init-options (gethash (eglot--major-mode server) +eglot/initialization-options-map)))
        init-options
      eglot--{}))

(add-to-list 'eglot-server-programs
               `(java-mode "jdtls"
                           "-configuration" ,(expand-file-name "cache/language-server/java/jdtls/config_linux" user-emacs-directory)
                           "-data" ,(expand-file-name "cache/java-workspace" user-emacs-directory)
                           ,(concat "--jvm-arg=-javaagent:" (exp…

Replies: 8 comments 4 replies

Comment options

You must be logged in to vote
2 replies
@theothornhill
Comment options

@dalanicolai
Comment options

Answer selected by hjudt
Comment options

You must be logged in to vote
1 reply
@joaotavora
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@joaotavora
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants