Subject: Re: bug#59138: Eglot support for java-language-server

From: Stefan Kangas <[email-masked]>
Date: Wed, 9 Nov 2022 07:14:54 -0800

Robert Brown <[email-masked]> writes:

> The attached patch adds Eglot support for Java LSP server
> https://github.com/georgewfraser/java-language-server
> From 8c874c0f277e2e1b85126120da9dcc54e4a938f8 Mon Sep 17 00:00:00 2001
> From: Robert Brown <[email-masked]>
> Date: Tue, 8 Nov 2022 19:23:10 -0500
> Subject: [PATCH] Support for java-language-server
>
>  * lisp/progmodes/eglot.el (eglot-server-programs): Add support for
>    Java server https://github.com/georgewfraser/java-language-server
> ---
>  lisp/progmodes/eglot.el | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el
> index ce989b5611..199c832f6b 100644
> --- a/lisp/progmodes/eglot.el
> +++ b/lisp/progmodes/eglot.el
> @@ -209,7 +209,8 @@ eglot-server-programs
>                                  (go-mode . ("gopls"))
>                                  ((R-mode ess-r-mode) . ("R" "--slave" "-e"
>                                                          "languageserver::run()"))
> -                                (java-mode . ("jdtls"))
> +                                (java-mode
> +                                 . ,(eglot-alternatives '("jdtls" "java-language-server")))

Thanks for the patch.

Is there any particular reason why we should prefer jdtls to
java-language-server?

>                                  (dart-mode . ("dart" "language-server"
>                                                "--client-id" "emacs.eglot-dart"))
>                                  (elixir-mode . ("language_server.sh"))
> --
> 2.25.1