From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#66726: 29.1; Eglot jdtls formatter ignored Date: Sat, 18 Nov 2023 10:40:03 +0200 Message-ID: <834jhjo3oc.fsf@gnu.org> References: <24934ba0-0577-4a05-bb46-8129982554ea@horstmann.com> <83il6pbphm.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18579"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 66726@debbugs.gnu.org To: joaotavora@gmail.com, Cay Horstmann Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Nov 18 09:41:10 2023 Return-path: 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 ) id 1r4Gt4-0004ea-Di for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 18 Nov 2023 09:41:10 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r4Gsw-0006wh-BM; Sat, 18 Nov 2023 03:41: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 ) id 1r4Gsv-0006wV-Az for bug-gnu-emacs@gnu.org; Sat, 18 Nov 2023 03:41:01 -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 ) id 1r4Gsv-0008H9-2z for bug-gnu-emacs@gnu.org; Sat, 18 Nov 2023 03:41:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r4Gsv-0006T5-Ou for bug-gnu-emacs@gnu.org; Sat, 18 Nov 2023 03:41:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 18 Nov 2023 08:41:01 +0000 Resent-Message-ID: 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.170029681324796 (code B ref 66726); Sat, 18 Nov 2023 08:41:01 +0000 Original-Received: (at 66726) by debbugs.gnu.org; 18 Nov 2023 08:40:13 +0000 Original-Received: from localhost ([127.0.0.1]:47771 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r4Gs9-0006Rp-Ao for submit@debbugs.gnu.org; Sat, 18 Nov 2023 03:40:13 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50554) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r4Gs7-0006Ra-H8 for 66726@debbugs.gnu.org; Sat, 18 Nov 2023 03:40:12 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r4Gs1-00084N-AQ; Sat, 18 Nov 2023 03:40:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=3DCK9qzGABgf3l+XIYS7dFXT4PoqDamCbAbM7jsIUmw=; b=fWY4SpwKixro2NW3UJvV W5PpRduwWeYOvWAWm7X9fU2wxqgMOHeOBTlX2u5CYeG+Jo1mzqis1xYufDbE2xC2Shxlv14wMyj1O AxeXna/T/8sLwkfhbWVAY7OhCohh7M9ymbrj5csG5LAFpel45530LkzLLKz5o9IK5zPvLh0pHmvX7 6ORzK6TiigDsyh7Yf4O5BqouDb96+yzGrkKdUSpcXJvNggvuPLygnOuQfXSVfs3cWLBIauKrPS0Ds FPdFadL6MKDhVNTvLh8FBvCX7oigWHx06xmEgSHto9Ms+DhQ1hppaPOkrvkVMuIae4s0lAnsI4sfR L0bkQ2QJMcelnQ==; In-Reply-To: (message from Cay Horstmann on Mon, 6 Nov 2023 18:16:01 +0100) 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" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-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:274534 Archived-At: > Date: Mon, 6 Nov 2023 18:16:01 +0100 > From: Cay Horstmann > Cc: 66726@debbugs.gnu.org > > > Cay, is there some kind of jtdls error log where it reports > > things? Can you also attach the Eglot stderr buffer, in case > > it has something useful? Use `M-x eglot-stderr-buffer`. > > > > The only thing that seems to be missing is the Emacs version, > > but I'll assume it's the version used in M-x report-emacs-bug > > itself, which is 29.1. > > > > João > > Hello, here is another stab at this. > > * There is no problem with that funny looking file:/// URL. jdtls can find it when invoked from VS Code and lsp-mode. > > * I attach the initialization that happens from VS Code. It looks just like the one that I am setting up in eglot. Look at the path initializationOptions.settings.java.format.settings. > > Formatting works fine in VS Code. The logs show requests such as this one: > > [Trace - 3:51:32 PM] Sending request 'textDocument/formatting - (71)'. > Params: { > "textDocument": { > "uri": "file:///tmp/test/NotHelloWorld.java" > }, > "options": { > "tabSize": 4, > "insertSpaces": true > } > } > > These look just like the ones that eglot sends. But the response is a formatting directive that follows the formatter, whereas with eglot, the response is a directive that follows some default. > > * Here is the requested eglot-stderr-buffer: > > WARNING: Using incubator modules: jdk.incubator.vector, jdk.incubator.foreign > Nov 06, 2023 4:20:36 PM org.apache.aries.spifly.BaseActivator log > INFO: Registered provider ch.qos.logback.classic.servlet.LogbackServletContainerInitializer of service jakarta.servlet.ServletContainerInitializer in bundle ch.qos.logback.classic > Nov 06, 2023 4:20:36 PM org.apache.aries.spifly.BaseActivator log > INFO: Registered provider ch.qos.logback.classic.spi.LogbackServiceProvider of service org.slf4j.spi.SLF4JServiceProvider in bundle ch.qos.logback.classic > > * Yes, it is Emacs 29.1. > > * The jdtls logs are a mystery to me. According to https://github.com/eclipse-jdtls/eclipse.jdt.ls/issues/752#issuecomment-412275314, > > "Should be in workspace/.metadata/.log, workspace location is a parameter you pass when starting the server." > > Who is "you"? I suppose the client, i.e. eglot or VS Code. I find files such as > > ./eglot-java-eclipse-jdt-cache/a397d9cc217eb5e87ff722051c2f059b/.metadata/.log > > but they don't contain any info on today's interactions. There is no other directory in that cache. I can tell from that log that the directory was passed as a --data command-line argument. But when I intercept jdtls today via a script to log the command-line args, there is no --data command-line argument passed when invoking jdtls. João?