GNU bug report logs - #69989
[PATCH] Fix invocation of Java Language Server

Previous Next

Package: emacs;

Reported by: Philip Kaludercic <philipk <at> posteo.net>

Date: Sun, 24 Mar 2024 20:37:02 UTC

Severity: normal

Tags: patch

Done: Philip Kaludercic <philipk <at> posteo.net>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 69989 in the body.
You can then email your comments to 69989 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to joaotavora <at> gmail.com, bug-gnu-emacs <at> gnu.org:
bug#69989; Package emacs. (Sun, 24 Mar 2024 20:37:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Philip Kaludercic <philipk <at> posteo.net>:
New bug report received and forwarded. Copy sent to joaotavora <at> gmail.com, bug-gnu-emacs <at> gnu.org. (Sun, 24 Mar 2024 20:37:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Philip Kaludercic <philipk <at> posteo.net>
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH] Fix invocation of Java Language Server
Date: Sun, 24 Mar 2024 20:34:26 +0000
[Message part 1 (text/plain, inline)]
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?

[0001-Fix-invocation-of-Java-Language-Server.patch (text/x-patch, attachment)]
[Message part 3 (text/plain, inline)]
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

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#69989; Package emacs. (Sun, 24 Mar 2024 20:46:02 GMT) Full text and rfc822 format available.

Message #8 received at 69989 <at> debbugs.gnu.org (full text, mbox):

From: Philip Kaludercic <philipk <at> posteo.net>
To: 69989 <at> debbugs.gnu.org
Cc: João Távora <joaotavora <at> gmail.com>
Subject: Re: bug#69989: [PATCH] Fix invocation of Java Language Server
Date: Sun, 24 Mar 2024 20:45:04 +0000
[Message part 1 (text/plain, inline)]
Philip Kaludercic <philipk <at> posteo.net> 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:

[0001-Add-Compat-as-an-Eglot-dependency.patch (text/x-diff, inline)]
From 8c1613a500a617c72b49905968c04e855fee9ee5 Mon Sep 17 00:00:00 2001
From: Philip Kaludercic <philipk <at> posteo.net>
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ão Távora <joaotavora <at> gmail.com>
 ;; 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-completion "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-completion "0.1") (compat "27.1"))
 
 ;; 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)
 
 ;; 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 compat
-            (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))))))
 
 (defun eglot--read-server (prompt &optional dont-if-just-the-one)
-- 
2.44.0

[Message part 3 (text/plain, inline)]
-- 
	Philip Kaludercic on icterid

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#69989; Package emacs. (Sun, 24 Mar 2024 21:38:01 GMT) Full text and rfc822 format available.

Message #11 received at 69989 <at> debbugs.gnu.org (full text, mbox):

From: Felician Nemeth <felician.nemeth <at> gmail.com>
To: Philip Kaludercic <philipk <at> posteo.net>
Cc: João Távora <joaotavora <at> gmail.com>,
 69989 <at> debbugs.gnu.org
Subject: Re: bug#69989: [PATCH] Fix invocation of Java Language Server
Date: Sun, 24 Mar 2024 22:35:45 +0100
> 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




Reply sent to Philip Kaludercic <philipk <at> posteo.net>:
You have taken responsibility. (Mon, 25 Mar 2024 07:12:01 GMT) Full text and rfc822 format available.

Notification sent to Philip Kaludercic <philipk <at> posteo.net>:
bug acknowledged by developer. (Mon, 25 Mar 2024 07:12:01 GMT) Full text and rfc822 format available.

Message #16 received at 69989-done <at> debbugs.gnu.org (full text, mbox):

From: Philip Kaludercic <philipk <at> posteo.net>
To: Felician Nemeth <felician.nemeth <at> gmail.com>
Cc: João Távora <joaotavora <at> gmail.com>,
 69989-done <at> debbugs.gnu.org
Subject: Re: bug#69989: [PATCH] Fix invocation of Java Language Server
Date: Mon, 25 Mar 2024 07:11:02 +0000
Felician Nemeth <felician.nemeth <at> gmail.com> 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




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 22 Apr 2024 11:24:18 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 62 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.