From: Eli Zaretskii <eliz@gnu.org>
To: "Cay Horstmann" <cay@horstmann.com>,
"João Távora" <joaotavora@gmail.com>
Cc: 66726@debbugs.gnu.org
Subject: bug#66726: 29.1; Eglot jdtls formatter ignored
Date: Sun, 29 Oct 2023 14:08:21 +0200 [thread overview]
Message-ID: <83il6pbphm.fsf@gnu.org> (raw)
In-Reply-To: <24934ba0-0577-4a05-bb46-8129982554ea@horstmann.com> (message from Cay Horstmann on Tue, 24 Oct 2023 11:17:09 +0200)
> Date: Tue, 24 Oct 2023 11:17:09 +0200
> From: Cay Horstmann <cay@horstmann.com>
>
> Eglot does not trigger a custom formatter with jdtls, while lsp-java and VS Code with the Red Hat Java plugin can do this. See https://github.com/joaotavora/eglot/discussions/1222 for more background.
>
> I attach files
> * eglot-debug.el (the minimal configuration to see the failure)
> * NotHelloWorld.java (a sample Java file)
> * cay-eclipse-formatter.xml (the formatting rules for jdtls)
> * eglot-events.txt (the events log from eglot)
> * lsp-java-debug.el (the minimal configuration to see how it works with lsp-java)
> * lsp-log.txt (the log from the successful run with lsp)
>
> Download jdtls from https://download.eclipse.org/jdtls/snapshots/?d. I
> have the version from Oct. 14, 2023. Put it somewhere on your PATH
>
> Put the NotHelloWorld.java file in some directory (I use /tmp/hello)
>
> Put the cay-eclipse-formatter.xml file somewhere and adjust the path in eglot-debug.el and lsp-java-debug.el.
>
> emacs -q -l eglot-debug.el /tmp/hello/NotHelloWorld.java
>
> M-x eglot RET
>
> Wait for jdtls to start
>
> M-x eglot-format-buffer RET
>
> The formatting should now use the rules in the cay-eclipse-formatter.xml
> file, resulting in 8 changes but the same Allman indentation
> style. Instead, it uses a K&R indentation style.
>
> To see the proper formatting, install lsp-mode and lsp-java and start with lsp-java-debug.el. Or use VS Code with the Red Hat Java plugin and the settings.json
>
> {
> "java.format.settings.url": "file:///data/cay/bin/cay-eclipse.formatter.xml",
> "java.format.settings.profile": "cay"
> }
João, any comments?
next prev parent reply other threads:[~2023-10-29 12:08 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-24 9:17 bug#66726: 29.1; Eglot jdtls formatter ignored Cay Horstmann
2023-10-29 12:08 ` Eli Zaretskii [this message]
2023-10-29 14:40 ` João Távora
2023-11-06 17:16 ` Cay Horstmann
2023-11-18 8:40 ` Eli Zaretskii
2023-11-18 9:36 ` João Távora
2024-01-07 9:39 ` Cay Horstmann
2024-01-08 11:37 ` João Távora
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83il6pbphm.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=66726@debbugs.gnu.org \
--cc=cay@horstmann.com \
--cc=joaotavora@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).