unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "João Távora" <joaotavora@gmail.com>
To: Cay Horstmann <cay@horstmann.com>
Cc: 66726@debbugs.gnu.org, Eli Zaretskii <eliz@gnu.org>
Subject: bug#66726: 29.1; Eglot jdtls formatter ignored
Date: Mon, 8 Jan 2024 11:37:57 +0000	[thread overview]
Message-ID: <CALDnm50dM61L1Sd+sxTe7YrSEbM5QVgzwDVGrY0RS+U_gPLMcg@mail.gmail.com> (raw)
In-Reply-To: <9bba987f-774e-444d-ac50-19ced52698c6@horstmann.com>

On Sun, Jan 7, 2024 at 9:40 AM Cay Horstmann <cay@horstmann.com> wrote:

> I was asked to reference the discussion on https://github.com/joaotavora/eglot/discussions/1222#discussioncomment-7683229

Yes, thank you for doing so.

> I reported that
>
> (remove-hook 'eglot-connect-hook 'eglot-signal-didChangeConfiguration)
>
> makes the formatter work. João Távora commented that this prevents Eglot from atomatically sending project-specific configuration to *any* server.
>
> I am unsure what the effects of that would be, but I gather from João's comment that it is not an acceptable solution.

It might not be acceptable for all users, yes.  It may be acceptable for you.

Here's a summary of this issue as I understand it:

1. jdtls's support for custom formatters can be achieved by passing suitable
   LSP :initializationOptions

2. According to you, jtdls's support for custom formatters _cannot_
   be achieved with LSP workspaceConfiguration.  It _has_ to use 1.

3. In jdtls, a blank LSP workspaceConfiguration request overwrites any
   settings passed in LSP initializationOptions.  This was confirmed
   by more than one user, I think.

2 and 3 dictate that, barring any changes on the jdtls side, the only
way to use custom formatters in Eglot is for Eglot to not send
LSP workspaceConfiguration to this server at all.  Has jdtls been made
aware of this conflict between 2 and 3?

You may also want to try the less intrusive:

(add-hook 'java-mode-hook (lambda ()
   (remove-hook 'eglot-connect-hook 'eglot-signal-didChangeConfiguration t))

To do it just for java-mode.  If you're using java-ts-mode, you need a similar
incantation, unless some java-base-mode exists (it exists for some Emacs
modes, not sure if Java)

João





      reply	other threads:[~2024-01-08 11:37 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
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 [this message]

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=CALDnm50dM61L1Sd+sxTe7YrSEbM5QVgzwDVGrY0RS+U_gPLMcg@mail.gmail.com \
    --to=joaotavora@gmail.com \
    --cc=66726@debbugs.gnu.org \
    --cc=cay@horstmann.com \
    --cc=eliz@gnu.org \
    /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).