GNU bug report logs - #59826
flymake-show-project-diagnotics not updating (eglot for Java with jdtls)

Previous Next

Package: emacs;

Reported by: David Ventimiglia <davidaventimiglia <at> neptunestation.com>

Date: Sun, 4 Dec 2022 23:18:02 UTC

Severity: normal

Full log


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

From: David Ventimiglia <davidaventimiglia <at> neptunestation.com>
To: 59826 <at> debbugs.gnu.org
Subject: additional info
Date: Mon, 5 Dec 2022 14:27:31 -0800
[Message part 1 (text/plain, inline)]
Taking an example Java servlet file ProtonServlet.java, when I add an
unused import there's an event like this:

[server-notification] Sun Dec  4 12:01:33 2022:
(:jsonrpc "2.0" :method "textDocument/publishDiagnostics" :params
 (:uri
"file:///home/neptunestationorg/Work/GitHub/ProtonChamber/src/main/java/org/protonchamber/ProtonServlet.java"
:diagnostics
[(:range
 (:start
  (:line 3 :character 7)
  :end
  (:line 3 :character 15))
 :severity 2 :code "268435844" :source "Java" :message "The import java.sql
is never used" :tags
 [1])]))


That makes sense. When I delete the unused import, there's an event like
this:

That also makes sense, as it seems to be that the server is publishing an
empty list of diagnostics for this file. Nevertheless, the
flymake-show-project-diagnostics buffer still has this entry:

ProtonServlet.java            4   8 warning  n        Java [268435844]: The
import java.sql is never used


Also, I see that sometimes warnings are supplied by one back-end, but then
when I fix the issue the same warning is then provided by a different
back-end. Here's what I mean. I have another file with an unused import for
java.sql. When I do, the diagnostics buffer shows an entry from the e-f-b
back-end, which I take to be the "eglot-flymake-backend":

SQLServlet.java               4   7 warning  e-f-b    Java [268435844]: The
import java.sql is never used


If I delete the offending line, the diagnostics buffer replaces that with
this:

SQLServlet.java               4   8 warning  n        Java [268435844]: The
import java.sql is never used


I don't know what the n back-end is, but evidently it's publishing its own
diagnostic for this code 268435844 which somehow is shadowed by the same
diagnostic for the same code from the e-f-b back-end. When the e-f-b
back-end correctly publishes an empty diagnostic report for this file, the
diagnostic report from the n back-end becomes revealed. Or something like
that.

Finally, I was sent a patch, which is attached.  When applied, that seemed
to fix the issue.
[Message part 2 (text/html, inline)]
[eglot.patch (text/x-patch, attachment)]

This bug report was last modified 2 years and 197 days ago.

Previous Next


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