From mboxrd@z Thu Jan  1 00:00:00 1970
Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail
From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= <joaotavora@gmail.com>
Newsgroups: gmane.emacs.bugs
Subject: bug#66726: 29.1; Eglot jdtls formatter ignored
Date: Mon, 8 Jan 2024 11:37:57 +0000
Message-ID: <CALDnm50dM61L1Sd+sxTe7YrSEbM5QVgzwDVGrY0RS+U_gPLMcg@mail.gmail.com>
References: <24934ba0-0577-4a05-bb46-8129982554ea@horstmann.com>
 <83il6pbphm.fsf@gnu.org>
 <CALDnm53x+Z_ATXrbn+FX=zAY5otySajcu2dctn29CPJ+3PZNqg@mail.gmail.com>
 <b52b69c8-047e-478f-9dba-e1d88a2ad9a8@horstmann.com> <834jhjo3oc.fsf@gnu.org>
 <CALDnm50DA+=Mi93nd6--9mD8=70EXYKMz-pfLPXDbq3xr3_NaQ@mail.gmail.com>
 <9bba987f-774e-444d-ac50-19ced52698c6@horstmann.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214";
	logging-data="19507"; mail-complaints-to="usenet@ciao.gmane.io"
Cc: 66726@debbugs.gnu.org, Eli Zaretskii <eliz@gnu.org>
To: Cay Horstmann <cay@horstmann.com>
Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jan 08 12:39:29 2024
Return-path: <bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org>
Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org
Original-Received: from lists.gnu.org ([209.51.188.17])
	by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
	(Exim 4.92)
	(envelope-from <bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org>)
	id 1rMnya-0004v7-QU
	for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 08 Jan 2024 12:39:28 +0100
Original-Received: from localhost ([::1] helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <bug-gnu-emacs-bounces@gnu.org>)
	id 1rMnyA-0004Dl-I2; Mon, 08 Jan 2024 06:39:02 -0500
Original-Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>)
 id 1rMny4-0004DP-H1
 for bug-gnu-emacs@gnu.org; Mon, 08 Jan 2024 06:38:56 -0500
Original-Received: from debbugs.gnu.org ([2001:470:142:5::43])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>)
 id 1rMny4-0000xP-8o
 for bug-gnu-emacs@gnu.org; Mon, 08 Jan 2024 06:38:56 -0500
Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2)
 (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1rMnyA-00088E-1z
 for bug-gnu-emacs@gnu.org; Mon, 08 Jan 2024 06:39:02 -0500
X-Loop: help-debbugs@gnu.org
Resent-From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?=
 <joaotavora@gmail.com>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@gnu.org
Resent-Date: Mon, 08 Jan 2024 11:39:02 +0000
Resent-Message-ID: <handler.66726.B66726.170471390431203@debbugs.gnu.org>
Resent-Sender: help-debbugs@gnu.org
X-GNU-PR-Message: followup 66726
X-GNU-PR-Package: emacs
Original-Received: via spool by 66726-submit@debbugs.gnu.org id=B66726.170471390431203
 (code B ref 66726); Mon, 08 Jan 2024 11:39:02 +0000
Original-Received: (at 66726) by debbugs.gnu.org; 8 Jan 2024 11:38:24 +0000
Original-Received: from localhost ([127.0.0.1]:35347 helo=debbugs.gnu.org)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <debbugs-submit-bounces@debbugs.gnu.org>)
 id 1rMnxY-00087D-7R
 for submit@debbugs.gnu.org; Mon, 08 Jan 2024 06:38:24 -0500
Original-Received: from mail-lj1-x235.google.com ([2a00:1450:4864:20::235]:61482)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <joaotavora@gmail.com>) id 1rMnxV-00086u-AQ
 for 66726@debbugs.gnu.org; Mon, 08 Jan 2024 06:38:22 -0500
Original-Received: by mail-lj1-x235.google.com with SMTP id
 38308e7fff4ca-2cd56dac1adso7840641fa.2
 for <66726@debbugs.gnu.org>; Mon, 08 Jan 2024 03:38:15 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1704713889; x=1705318689; darn=debbugs.gnu.org;
 h=content-transfer-encoding:cc:to:subject:message-id:date:from
 :in-reply-to:references:mime-version:from:to:cc:subject:date
 :message-id:reply-to;
 bh=GxjEY+oefjhV/aCXP1aqBprosoAaZfcn122+IOaFP5k=;
 b=i258P9BPzLThroXRUQyoRxm3La7EvfDbNpknKXayUHAHGiqUFuUg0KXlhFznQYiZG9
 1uHSVjMr6rWHH1XAa8lIcPpgnpharcRK7Qj0CzK37Gx5XNZNdpdvVVhLZZvbdjfP6ru+
 gmAKfl7CczV86qtYyqzFYA5ZLJ0PqG5XqpREnuFMhAzWpXZK7mnBxebJI2+Xdol9KguI
 8/5OrA5o8G+LRlQFFqj45X/QLdjB973IYev3d9G2cH/kheckES6SRrao5V6X3+rfhDmj
 CrTyTmTzFHSiitJdnr4bcDROTW+zm+X4ixR2rerPWOerGaJZ+z6Kc0eIqdLUMUE6bnQU
 b6Yw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1704713889; x=1705318689;
 h=content-transfer-encoding:cc:to:subject:message-id:date:from
 :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
 :subject:date:message-id:reply-to;
 bh=GxjEY+oefjhV/aCXP1aqBprosoAaZfcn122+IOaFP5k=;
 b=lSHZCLCWla1AejvyALPCmQsmiYInYbV6dDotFTcaH6TVGEklwVbxcWmbNZtVUyAYAa
 mm8QuLjSBz9sQQ8kSGU+V9RSg3gZ3OvfZSx6F9yvfJBYv/yWnhctUoEtXjZEfns07oDA
 v4ymM9MsDz9PXQXkmvXFbx7M0bBpCfKApNivJgvwgLZGxTK+ZMUk7B3SBdk8zTiaWO+f
 7Ug08UDsLzjd8fmQyJRGKaZwsjms1EqUgnji/a2A/I1kUxUypg4JQfhqQOMs62Oy8331
 MMy4vd4CluAfn/bKF/irkwSf7dBNhfqHGJQLTWbiyhFwjpUPWRlXxzxrmZo+MYnvxiVq
 RVBA==
X-Gm-Message-State: AOJu0YzPxSwG2JcIPjM6NbQg5VhsFx/Vz68VCA5d9CwyCsu55OPZ+6/M
 sprkWSaojQYQrwmkMpIIcVvh5EfwginUQoawbe4=
X-Google-Smtp-Source: AGHT+IEOksYBaY0N7Cc2qzPoBOwuWPKDSblmz+Gliv/eA9BaHrQzT+tm0t26KDUq7oRe2G/x9SDcmhysR4bUz5cumEk=
X-Received: by 2002:a2e:804d:0:b0:2cd:1d5d:322e with SMTP id
 p13-20020a2e804d000000b002cd1d5d322emr1466988ljg.10.1704713889064; Mon, 08
 Jan 2024 03:38:09 -0800 (PST)
In-Reply-To: <9bba987f-774e-444d-ac50-19ced52698c6@horstmann.com>
X-BeenThere: debbugs-submit@debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
X-BeenThere: bug-gnu-emacs@gnu.org
List-Id: "Bug reports for GNU Emacs,
 the Swiss army knife of text editors" <bug-gnu-emacs.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-gnu-emacs>,
 <mailto:bug-gnu-emacs-request@gnu.org?subject=unsubscribe>
List-Archive: <https://lists.gnu.org/archive/html/bug-gnu-emacs>
List-Post: <mailto:bug-gnu-emacs@gnu.org>
List-Help: <mailto:bug-gnu-emacs-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-gnu-emacs>,
 <mailto:bug-gnu-emacs-request@gnu.org?subject=subscribe>
Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org
Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org
Xref: news.gmane.io gmane.emacs.bugs:277548
Archived-At: <http://permalink.gmane.org/gmane.emacs.bugs/277548>

On Sun, Jan 7, 2024 at 9:40=E2=80=AFAM Cay Horstmann <cay@horstmann.com> wr=
ote:

> 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=C3=A3o T=C3=A1vora commented that this preve=
nts 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=C3=A3=
o's comment that it is not an acceptable solution.

It might not be acceptable for all users, yes.  It may be acceptable for yo=
u.

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

1. jdtls's support for custom formatters can be achieved by passing suitabl=
e
   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 simi=
lar
incantation, unless some java-base-mode exists (it exists for some Emacs
modes, not sure if Java)

Jo=C3=A3o