Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support specifying extra VM arguments for the Java Language server #800

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
22 changes: 15 additions & 7 deletions eglot.el
Original file line number Diff line number Diff line change
Expand Up @@ -3005,6 +3005,13 @@ If NOERROR, return predicate, else erroring function."

;;; eclipse-jdt-specific
;;;
(defcustom eglot-eclipse-jdt-vmargs '()
"Configure Java VM to tune its behaviour or support particular libraries.
For example, if you are a Lombok user, you can specify the argument needed here.
You can also specify some arguments to reduce memory consumption,
see https://github.com/redhat-developer/vscode-java/pull/1262 for more details."
:type '(repeat string))

(defclass eglot-eclipse-jdt (eglot-lsp-server) ()
:documentation "Eclipse's Java Development Tools Language Server.")

Expand Down Expand Up @@ -3083,13 +3090,14 @@ If INTERACTIVE, prompt user for details."
(unless (file-directory-p workspace)
(make-directory workspace t))
(cons 'eglot-eclipse-jdt
(list (executable-find "java")
"-Declipse.application=org.eclipse.jdt.ls.core.id1"
"-Dosgi.bundles.defaultStartLevel=4"
"-Declipse.product=org.eclipse.jdt.ls.core.product"
"-jar" jar
"-configuration" config
"-data" workspace)))))
`(,(executable-find "java")
"-Declipse.application=org.eclipse.jdt.ls.core.id1"
"-Dosgi.bundles.defaultStartLevel=4"
"-Declipse.product=org.eclipse.jdt.ls.core.product"
,@eglot-eclipse-jdt-vmargs
"-jar" ,jar
"-configuration" ,config
"-data" ,workspace)))))

(cl-defmethod eglot-execute-command
((_server eglot-eclipse-jdt) (_cmd (eql java.apply.workspaceEdit)) arguments)
Expand Down