From unknown Mon Jun 23 11:28:06 2025 X-Loop: help-debbugs@gnu.org Subject: bug#69989: [PATCH] Fix invocation of Java Language Server Resent-From: Philip Kaludercic Original-Sender: "Debbugs-submit" Resent-CC: joaotavora@gmail.com, bug-gnu-emacs@gnu.org Resent-Date: Sun, 24 Mar 2024 20:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 69989 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: 69989@debbugs.gnu.org Cc: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= X-Debbugs-Original-To: bug-gnu-emacs@gnu.org X-Debbugs-Original-Xcc: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Received: via spool by submit@debbugs.gnu.org id=B.17113125659162 (code B ref -1); Sun, 24 Mar 2024 20:37:02 +0000 Received: (at submit) by debbugs.gnu.org; 24 Mar 2024 20:36:05 +0000 Received: from localhost ([127.0.0.1]:47460 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1roUZY-0002Nh-Em for submit@debbugs.gnu.org; Sun, 24 Mar 2024 16:36:04 -0400 Received: from lists.gnu.org ([209.51.188.17]:50096) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1roUZT-0002NG-DP for submit@debbugs.gnu.org; Sun, 24 Mar 2024 16:36:03 -0400 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 1roUYn-0001ua-55 for bug-gnu-emacs@gnu.org; Sun, 24 Mar 2024 16:35:17 -0400 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1roUYk-0002zO-VC for bug-gnu-emacs@gnu.org; Sun, 24 Mar 2024 16:35:16 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id BEC27240028 for ; Sun, 24 Mar 2024 21:35:08 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1711312508; bh=zc7jkoplGzodrl9j5IJ+3TSPq/Q9PyHOfK0geNqoB8s=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=LWpMSDCec5eSZG2+OKhamGdVkBY2r+9KlyMuntEP6yOz87R7Dz2PlumT3HT5I2jn9 W3iyUUS9bRkTopy+x7UNxKluMlJLjJ+7mxzazwBk87jethqM8oS9FwxAHXRqeASkkY OeOoIqPbeh1EFxb0W2OxiBKIEkwM8XRutHnuBMIegXCBnS1tZ5XQi63tUAc4GnGjhT wl8JDxxYXVFi1Vs5NIWbVOY9OyVevnzAUUATo5Ngiuzahe++ckwPtkeZAqvp5ehauS kin3ETHborXavgswq57udkano3Gn4+kNx7ACBL6ahGG+R3IKzh/qT65HgP1+AA0EJH 2nQVo4K6m9Nwg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4V2nqw0pQWz6tvh for ; Sun, 24 Mar 2024 21:35:07 +0100 (CET) From: Philip Kaludercic X-Hashcash: 1:20:240324:bug-gnu-emacs@gnu.org::8glFO+QRq+tDHsNO:0EQZ Date: Sun, 24 Mar 2024 20:34:26 +0000 Message-ID: <87y1a78j3h.fsf@posteo.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=185.67.36.65; envelope-from=philipk@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) --=-=-= Content-Type: text/plain It appears that the Java Language Server "jdtls" unfortunately requires a "-data" flag to be passed along with some directory to function properly. Otherwise it fails or only provides primitive syntax checking, and no completion or other warnings. This was discussed on the Eglot issue tracker [0]. The following patch would invoke the server properly, passing project-specific cache directory for the program to use. I use `xdg-cache-home' to determine what directory to use, but didn't want to load it at the top of the file. Are there any strong opinions on that question? --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Fix-invocation-of-Java-Language-Server.patch Content-Description: [PATCH] Fix invocation of Java Language Server >From dae847f979084134effa256b95de7219c1d5dbf6 Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Sun, 24 Mar 2024 21:26:08 +0100 Subject: [PATCH] Fix invocation of Java Language Server * lisp/progmodes/eglot.el (eglot-server-programs): Invoke "jdtls" with a "-data" flag, passing a project-specific cache directory. --- lisp/progmodes/eglot.el | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index f341428cac3..f2298b2e079 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -226,6 +226,7 @@ eglot-alternatives when probe return (cons probe args) finally (funcall err))))))) +(declare-function xdg-cache-home "xdg" ()) (defvar eglot-server-programs `(((rust-ts-mode rust-mode) . ("rust-analyzer")) ((cmake-mode cmake-ts-mode) . ("cmake-language-server")) (vimrc-mode . ("vim-language-server" "--stdio")) @@ -264,7 +265,13 @@ eglot-server-programs . ("gopls")) ((R-mode ess-r-mode) . ("R" "--slave" "-e" "languageserver::run()")) - ((java-mode java-ts-mode) . ("jdtls")) + ((java-mode java-ts-mode) . + ,(lambda (_interactive project) ;see github#1008 + (require 'xdg) + (let ((cache (file-name-concat + (xdg-cache-home) "jdtls-cache" + (sha1 (project-root project))))) + (list "jdtls" "-data" cache)))) ((dart-mode dart-ts-mode) . ("dart" "language-server" "--client-id" "emacs.eglot-dart")) -- 2.39.2 --=-=-= Content-Type: text/plain Oh and this patch uses functions that are not available in Emacs 26.3, so it would make sense to apply my patch that adds Compat support to Eglot first. [0] https://github.com/joaotavora/eglot/issues/1008 -- Philip Kaludercic on icterid --=-=-=-- From unknown Mon Jun 23 11:28:06 2025 X-Loop: help-debbugs@gnu.org Subject: bug#69989: [PATCH] Fix invocation of Java Language Server Resent-From: Philip Kaludercic Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 24 Mar 2024 20:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69989 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: 69989@debbugs.gnu.org Cc: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Received: via spool by 69989-submit@debbugs.gnu.org id=B69989.171131315710227 (code B ref 69989); Sun, 24 Mar 2024 20:46:02 +0000 Received: (at 69989) by debbugs.gnu.org; 24 Mar 2024 20:45:57 +0000 Received: from localhost ([127.0.0.1]:47466 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1roUj6-0002et-Pv for submit@debbugs.gnu.org; Sun, 24 Mar 2024 16:45:57 -0400 Received: from mout02.posteo.de ([185.67.36.66]:58631) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1roUj4-0002eZ-5k for 69989@debbugs.gnu.org; Sun, 24 Mar 2024 16:45:55 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id C51F7240105 for <69989@debbugs.gnu.org>; Sun, 24 Mar 2024 21:45:05 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1711313105; bh=JHqz5sZoNVACjrDV9FWMmGm+RCf7/MB451C0PM0GagA=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: From; b=TRt084CygXyTE5GCBjKtkZNunQzVwz3s3oxpQo6aDutdQpGTPntrv3bwlTOp75Qxe Gv85nl9wXJ5rTdEU/FZmzvQjiYScHRCyBDMoutwqLRpxK3Si7U2ki7S2JA+uepIZgU pGfgK1//tZb4Ki0xLsF968eHsPrGWOZ3YpoABkWj4CoYEpPmHFAjihGaDMeN0AH6YQ bZiX1QpyTrt8//qRgYAy6G+RnbCXWEulNSQJzAw2hLkJCftx1sXfU0tA6oTtG2ube6 X3A00l8uIuqPUFZ48FRwlC+FaBwjJR1WrM/mp2Bfk3ywCFB0yy1w6c0OWNsFBvsO+d 4LfJoKflLeVFQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4V2p3P1TbNz6twB; Sun, 24 Mar 2024 21:45:05 +0100 (CET) From: Philip Kaludercic In-Reply-To: <87y1a78j3h.fsf@posteo.net> (Philip Kaludercic's message of "Sun, 24 Mar 2024 20:34:26 +0000") References: <87y1a78j3h.fsf@posteo.net> X-Hashcash: 1:20:240324:69989@debbugs.gnu.org::heqDi5rGHu6QPu4g:No9 X-Hashcash: 1:20:240324:joaotavora@gmail.com::K9MZJQeClxYFBIVB:16L2 Date: Sun, 24 Mar 2024 20:45:04 +0000 Message-ID: <87ttkv8ilr.fsf@posteo.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) --=-=-= Content-Type: text/plain Philip Kaludercic writes: > Oh and this patch uses functions that are not available in Emacs 26.3, > so it would make sense to apply my patch that adds Compat support to > Eglot first. Apparently my patch did not arrive on the mailing list, so I am attaching it again here: --=-=-= Content-Type: text/x-diff; charset=utf-8 Content-Disposition: inline; filename=0001-Add-Compat-as-an-Eglot-dependency.patch Content-Transfer-Encoding: quoted-printable >From 8c1613a500a617c72b49905968c04e855fee9ee5 Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Sat, 9 Mar 2024 08:11:03 +0100 Subject: [PATCH] Add Compat as an Eglot dependency * lisp/progmodes/eglot.el (eglot--format-markup): Remove fboundp check for 'text-property-search-forward'. Additionally this should make 'package-get-version' available for releases of Emacs previous to 27.1. (bug#62198) --- lisp/progmodes/eglot.el | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 50820e81107..62606d8dbb2 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -7,7 +7,7 @@ ;; Maintainer: Jo=C3=A3o T=C3=A1vora ;; URL: https://github.com/joaotavora/eglot ;; Keywords: convenience, languages -;; Package-Requires: ((emacs "26.3") (jsonrpc "1.0.24") (flymake "1.2.1") = (project "0.9.8") (xref "1.6.2") (eldoc "1.14.0") (seq "2.23") (external-co= mpletion "0.1")) +;; Package-Requires: ((emacs "26.1") (jsonrpc "1.0.24") (flymake "1.2.1") = (project "0.9.8") (xref "1.6.2") (eldoc "1.14.0") (seq "2.23") (external-co= mpletion "0.1") (compat "27.1")) =20 ;; This is a GNU ELPA :core package. Avoid adding functionality ;; that is not available in the version of Emacs recorded above or any @@ -110,6 +110,7 @@ (require 'text-property-search nil t) (require 'diff-mode) (require 'diff) +(require 'compat) =20 ;; These dependencies are also GNU ELPA core packages. Because of ;; bug#62576, since there is a risk that M-x package-install, despite @@ -1831,10 +1832,9 @@ eglot--format-markup (font-lock-ensure) (goto-char (point-min)) (let ((inhibit-read-only t)) - (when (fboundp 'text-property-search-forward) ;; FIXME: use comp= at - (while (setq match (text-property-search-forward 'invisible)) - (delete-region (prop-match-beginning match) - (prop-match-end match))))) + (while (setq match (text-property-search-forward 'invisible)) + (delete-region (prop-match-beginning match) + (prop-match-end match)))) (string-trim (buffer-string)))))) =20 (defun eglot--read-server (prompt &optional dont-if-just-the-one) --=20 2.44.0 --=-=-= Content-Type: text/plain -- Philip Kaludercic on icterid --=-=-=-- From unknown Mon Jun 23 11:28:06 2025 X-Loop: help-debbugs@gnu.org Subject: bug#69989: [PATCH] Fix invocation of Java Language Server Resent-From: Felician Nemeth Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 24 Mar 2024 21:38:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69989 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Philip Kaludercic Cc: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= , 69989@debbugs.gnu.org Received: via spool by 69989-submit@debbugs.gnu.org id=B69989.171131625626887 (code B ref 69989); Sun, 24 Mar 2024 21:38:01 +0000 Received: (at 69989) by debbugs.gnu.org; 24 Mar 2024 21:37:36 +0000 Received: from localhost ([127.0.0.1]:47521 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1roVX6-0006za-8J for submit@debbugs.gnu.org; Sun, 24 Mar 2024 17:37:36 -0400 Received: from mail-ej1-f46.google.com ([209.85.218.46]:51594) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1roVX5-0006zK-3r for 69989@debbugs.gnu.org; Sun, 24 Mar 2024 17:37:35 -0400 Received: by mail-ej1-f46.google.com with SMTP id a640c23a62f3a-a44ad785a44so416509466b.3 for <69989@debbugs.gnu.org>; Sun, 24 Mar 2024 14:36:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711316147; x=1711920947; darn=debbugs.gnu.org; h=mime-version:face:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=F8RFDb+k9bm23WWC37MpH12z/sjarPr5kUO++i7/G3Y=; b=j4/DBbkDWs4grAQMCa8oe4W6YjkeZbrCYg3c+Z5XulWkYil08ey9ZhA5uUkIOCuEq6 ij3JxKSr6u5PMio/DmfFko/0zs45DuNCeVDYTsF3tHG4N8f2DTzEIolXzo3l8qMchVxk CapZDsZ7MYrP8STJrYHJgoCR9oS40gfwjlIzrcjy7wpAgcPAdYYSIAdRdmoP25bQk752 MbQ6GXwo1HgDuFQyhrxvZftzqFWeIxXUI6/2j8ZGnsu8vBawKmMYgyLgag4pTWIq7evd DAG+JKbPRWCA8CYPXbwWUkp46yV/2LhuZ0WpPGBJgK41AVYIQ5UKhPpzrku0OER/Lwif Crjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711316147; x=1711920947; h=mime-version:face:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=F8RFDb+k9bm23WWC37MpH12z/sjarPr5kUO++i7/G3Y=; b=aQ6zhKKtlH7zE6sKnop2vcrXJbejIu5XGo31IRm1BCYphJjDVgCkvzuFAZHkIHLUvf Gwu1HIKRXfAyg3wHNpZvdX37FnLsZ4Rha653VXWnYXxA+JvnEyMS0RjojnPJGE69sl5P p9rW7irpYJp8tTeXnI37sOvZvn7Tg6eDAnBoiAfvLJIkX28qhqP2Z200sZbVEyra/x1B tlEm7ujHN5TGBlDWHireqHRwQvJi/P+rtF37V+A7Jn+SPTIBWg2A/5iNOgkr2yPeVRHq joIv1cBT3bWV6o0oeOltp1aEsmCTzyUzC9IKTjb6Boc9U2a9I9JOMUQijSvkB2nhlxd8 GabA== X-Gm-Message-State: AOJu0YwyIP/gMt4Jxhd55kvXbTyFqnTXJYt5LkvcqDO8z1lkb/OeQuZ2 ehn5gD703/KX8TiKHN6u5GMHst+IUYDdABHhTrIkcUcz0mgoBN4T X-Google-Smtp-Source: AGHT+IFDmLOyDATuxCrqxHzJwTDXt7sOgfa7CGRsvQvBF1rjN4LYHato2iXLvif2kfr88NaduIbVzA== X-Received: by 2002:a17:907:3207:b0:a47:45ab:9ca2 with SMTP id xg7-20020a170907320700b00a4745ab9ca2mr3210983ejb.53.1711316147048; Sun, 24 Mar 2024 14:35:47 -0700 (PDT) Received: from betli.gmail.com (catv-213-222-160-137.catv.fixed.vodafone.hu. [213.222.160.137]) by smtp.gmail.com with ESMTPSA id ov30-20020a170906fc1e00b00a46a3ad035esm2357971ejb.179.2024.03.24.14.35.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Mar 2024 14:35:46 -0700 (PDT) From: Felician Nemeth References: <87y1a78j3h.fsf@posteo.net> Date: Sun, 24 Mar 2024 22:35:45 +0100 In-Reply-To: <87y1a78j3h.fsf@posteo.net> (Philip Kaludercic's message of "Sun, 24 Mar 2024 20:34:26 +0000") Message-ID: <87o7b3nwi6.fsf@betli.tmit.bme.hu> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAElBMVEWOdXElERN7LDLZs6/l 0dDQq6TepMcqAAACW0lEQVQ4jWWSzY7bMAyEaSm6mypylxjkroTRvUW8d9lavf+r7NDOZotWQHzg lyGHP0Sn5ed9qKrLWWIWos9/QJWIeCSywPNTd/AE0LtwFj7A+3WT5PwfeBrQKcsBnkfwVcNySWQr 3i34XN6gRNgis/v4uwSKHCD9lPitB0Aq9BHfHX4cgsI7cJJfLdZg/4bbCzoRmkD9MsagQSBDedZi CgNxkVSJmSOStTBUBKkywEnEoZzbwWj+ACiVJkF6pOpak2PMCqkMYDpaw+gatLR8atMOrB3JGzmm 3rSQo+tkxU+UAbhQSgtslULhsXKk6+IyQ1QTzeQB0MzjlpkCEUCeUdviWrwBcxVqpZjP+v0MYPA0 aq2rvIEZe4GRM0v+9QIB03rsABVSk5y+Mz3LSzExtJLlCCO6dV1uzDQFTBad+gO0TqqL9XE8x4ek +orvYiMJgzC8e+r6TqaPaK6QyqVNvoHtsRrooQ6tTi4vgaSkd8wIikodB3B0iIk58avsDdYNajpS bSKJ+mQnipGszB6zW4lGgsOkKHE2RWVcBpwhaIv3BYIAu3WsnC7YYKLRchp6w8fRGZIWiZuFsVai 7gbcUcJEhiDZ3K1+uzZvBlfaEO8oH4MLu6/hrKVM7QpQcIXJFuC1XjfbfKRxNslk94l9cYcEihV2 HWyNDQAXaLsvnrSyp7HaQhrAn13V6/XW11nh0XINBOEAV+tHK4EvAGNGvEwc0eZw8Vyr56imYEsV sOW9jxm/yb9AH1ufqGMviIK7A0Tc/723oM3tJ4HTOu9gDr3ftbdkxfdjsUv5AqWKwyfCYo5WAAAA AElFTkSuQmCC MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > It appears that the Java Language Server "jdtls" unfortunately requires > a "-data" flag to be passed along with some directory to function > properly. Otherwise it fails or only provides primitive syntax > checking, and no completion or other warnings. This was discussed on > the Eglot issue tracker [0]. I don't use jdtls, but it seems the upstream fixed this issue and there is no need to modify Eglot. https://github.com/eclipse-jdtls/eclipse.jdt.ls/pull/2207 https://github.com/eclipse-jdtls/eclipse.jdt.ls/commit/b93370662a8e4e552dc2af162eb9510b276e0203 From unknown Mon Jun 23 11:28:06 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Philip Kaludercic Subject: bug#69989: closed (Re: bug#69989: [PATCH] Fix invocation of Java Language Server) Message-ID: References: <87cyri4whl.fsf@posteo.net> <87y1a78j3h.fsf@posteo.net> X-Gnu-PR-Message: they-closed 69989 X-Gnu-PR-Package: emacs X-Gnu-PR-Keywords: patch Reply-To: 69989@debbugs.gnu.org Date: Mon, 25 Mar 2024 07:12:01 +0000 Content-Type: multipart/mixed; boundary="----------=_1711350721-4494-1" This is a multi-part message in MIME format... ------------=_1711350721-4494-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #69989: [PATCH] Fix invocation of Java Language Server which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 69989@debbugs.gnu.org. --=20 69989: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D69989 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1711350721-4494-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 69989-done) by debbugs.gnu.org; 25 Mar 2024 07:11:57 +0000 Received: from localhost ([127.0.0.1]:47813 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1roeUv-0001AF-H1 for submit@debbugs.gnu.org; Mon, 25 Mar 2024 03:11:57 -0400 Received: from mout02.posteo.de ([185.67.36.66]:54115) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1roeUq-00019y-3J for 69989-done@debbugs.gnu.org; Mon, 25 Mar 2024 03:11:56 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 99D57240103 for <69989-done@debbugs.gnu.org>; Mon, 25 Mar 2024 08:11:03 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1711350663; bh=22t8lBj6tCSrdZnTCZNPUTD6HyuUNVtcwR4PmvV/ZvE=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: From; b=np6XblJ2XENcVSdruqOJr0lIf9TvxKvoxwnAcGY+lO1XlxtQOpuXixUWTvM97wcaA 4LyDIyiTcmTFznwGVAvaTyPHop4KUvZMCs6AKQ0qYEEM2D49Dn+J2EFQyBDFV9XJ5/ SN9t255t97R2T5jmcWhW9qFpZL1FY8m6IHQ4qwZ1bEJhQhBGsCBVXMf0uo32U5c6MQ 2D3GAvIH9aSx1K1nwyQyYKS+sweL8jOkUIOI/OrFS+aJUwDBo3LS1+5qpPBye4/9xz whsVCnJQJdwATcJJFYrwOqSxX2Ro+59LHpe1FVq3qMrA9eb+wpvnpVHu/eIKTvBxY1 y8UVhsT6iM94g== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4V33xf6QBTz9rxD; Mon, 25 Mar 2024 08:11:02 +0100 (CET) From: Philip Kaludercic To: Felician Nemeth Subject: Re: bug#69989: [PATCH] Fix invocation of Java Language Server In-Reply-To: <87o7b3nwi6.fsf@betli.tmit.bme.hu> (Felician Nemeth's message of "Sun, 24 Mar 2024 22:35:45 +0100") References: <87y1a78j3h.fsf@posteo.net> <87o7b3nwi6.fsf@betli.tmit.bme.hu> X-Hashcash: 1:20:240325:felician.nemeth@gmail.com::Xso19IH/PWaW58EP:TeR X-Hashcash: 1:20:240325:joaotavora@gmail.com::yyDxQqex9i1hA1Dv:0c47 X-Hashcash: 1:20:240325:69989@debbugs.gnu.org::Ri+yBK76QX39j4j6:3WUH Date: Mon, 25 Mar 2024 07:11:02 +0000 Message-ID: <87cyri4whl.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 69989-done Cc: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= , 69989-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Felician Nemeth writes: >> It appears that the Java Language Server "jdtls" unfortunately requires >> a "-data" flag to be passed along with some directory to function >> properly. Otherwise it fails or only provides primitive syntax >> checking, and no completion or other warnings. This was discussed on >> the Eglot issue tracker [0]. > > I don't use jdtls, but it seems the upstream fixed this issue and there > is no need to modify Eglot. > > https://github.com/eclipse-jdtls/eclipse.jdt.ls/pull/2207 > https://github.com/eclipse-jdtls/eclipse.jdt.ls/commit/b93370662a8e4e552dc2af162eb9510b276e0203 Turns out I had an older installation of jdtls. I have upgraded it and can confirm that it works without the patch. So I'll be closing this report. -- Philip Kaludercic on icterid ------------=_1711350721-4494-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 24 Mar 2024 20:36:05 +0000 Received: from localhost ([127.0.0.1]:47460 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1roUZY-0002Nh-Em for submit@debbugs.gnu.org; Sun, 24 Mar 2024 16:36:04 -0400 Received: from lists.gnu.org ([209.51.188.17]:50096) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1roUZT-0002NG-DP for submit@debbugs.gnu.org; Sun, 24 Mar 2024 16:36:03 -0400 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 1roUYn-0001ua-55 for bug-gnu-emacs@gnu.org; Sun, 24 Mar 2024 16:35:17 -0400 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1roUYk-0002zO-VC for bug-gnu-emacs@gnu.org; Sun, 24 Mar 2024 16:35:16 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id BEC27240028 for ; Sun, 24 Mar 2024 21:35:08 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1711312508; bh=zc7jkoplGzodrl9j5IJ+3TSPq/Q9PyHOfK0geNqoB8s=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=LWpMSDCec5eSZG2+OKhamGdVkBY2r+9KlyMuntEP6yOz87R7Dz2PlumT3HT5I2jn9 W3iyUUS9bRkTopy+x7UNxKluMlJLjJ+7mxzazwBk87jethqM8oS9FwxAHXRqeASkkY OeOoIqPbeh1EFxb0W2OxiBKIEkwM8XRutHnuBMIegXCBnS1tZ5XQi63tUAc4GnGjhT wl8JDxxYXVFi1Vs5NIWbVOY9OyVevnzAUUATo5Ngiuzahe++ckwPtkeZAqvp5ehauS kin3ETHborXavgswq57udkano3Gn4+kNx7ACBL6ahGG+R3IKzh/qT65HgP1+AA0EJH 2nQVo4K6m9Nwg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4V2nqw0pQWz6tvh for ; Sun, 24 Mar 2024 21:35:07 +0100 (CET) From: Philip Kaludercic To: bug-gnu-emacs@gnu.org Subject: [PATCH] Fix invocation of Java Language Server X-Hashcash: 1:20:240324:bug-gnu-emacs@gnu.org::8glFO+QRq+tDHsNO:0EQZ X-Debbugs-CC: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= Date: Sun, 24 Mar 2024 20:34:26 +0000 Message-ID: <87y1a78j3h.fsf@posteo.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=185.67.36.65; envelope-from=philipk@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) --=-=-= Content-Type: text/plain It appears that the Java Language Server "jdtls" unfortunately requires a "-data" flag to be passed along with some directory to function properly. Otherwise it fails or only provides primitive syntax checking, and no completion or other warnings. This was discussed on the Eglot issue tracker [0]. The following patch would invoke the server properly, passing project-specific cache directory for the program to use. I use `xdg-cache-home' to determine what directory to use, but didn't want to load it at the top of the file. Are there any strong opinions on that question? --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Fix-invocation-of-Java-Language-Server.patch Content-Description: [PATCH] Fix invocation of Java Language Server >From dae847f979084134effa256b95de7219c1d5dbf6 Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Sun, 24 Mar 2024 21:26:08 +0100 Subject: [PATCH] Fix invocation of Java Language Server * lisp/progmodes/eglot.el (eglot-server-programs): Invoke "jdtls" with a "-data" flag, passing a project-specific cache directory. --- lisp/progmodes/eglot.el | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index f341428cac3..f2298b2e079 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -226,6 +226,7 @@ eglot-alternatives when probe return (cons probe args) finally (funcall err))))))) +(declare-function xdg-cache-home "xdg" ()) (defvar eglot-server-programs `(((rust-ts-mode rust-mode) . ("rust-analyzer")) ((cmake-mode cmake-ts-mode) . ("cmake-language-server")) (vimrc-mode . ("vim-language-server" "--stdio")) @@ -264,7 +265,13 @@ eglot-server-programs . ("gopls")) ((R-mode ess-r-mode) . ("R" "--slave" "-e" "languageserver::run()")) - ((java-mode java-ts-mode) . ("jdtls")) + ((java-mode java-ts-mode) . + ,(lambda (_interactive project) ;see github#1008 + (require 'xdg) + (let ((cache (file-name-concat + (xdg-cache-home) "jdtls-cache" + (sha1 (project-root project))))) + (list "jdtls" "-data" cache)))) ((dart-mode dart-ts-mode) . ("dart" "language-server" "--client-id" "emacs.eglot-dart")) -- 2.39.2 --=-=-= Content-Type: text/plain Oh and this patch uses functions that are not available in Emacs 26.3, so it would make sense to apply my patch that adds Compat support to Eglot first. [0] https://github.com/joaotavora/eglot/issues/1008 -- Philip Kaludercic on icterid --=-=-=-- ------------=_1711350721-4494-1--