Subject: Re: flymake-show-project-diagnotics not updating (eglot for Java with jdtls)

From: João Távora <[email-masked]>
Date: Mon, 5 Dec 2022 11:30:54 +0000

On Sun, Dec 4, 2022 at 11:23 PM David Ventimiglia <
[email-masked]> wrote:
>
> That seems to have fixed it.  Can you explain what's going on here?

What's going on is "a lot" or "not much" depending on the level of detail
you're after.

There are two main types of project-wide diagnostic, as described in the
manual,
depending on whether the file that the diagnostic refers to is or isn't
visited by emacs
with Flymake enabled.

As [1] explains, the unvisited type can be handled by "foreign" or
"list-only" diagnostics.
Eglot uses the latter.  When Eglot is activated in a buffer visiting one of
the files that
were in 'flymake-list-only-diagnostics' it needs to remember to remove that
file from
that list, as it is no longer needed there.  This wasn't happening and my
patch fixes it.
The project listing is then refreshed automatically (at least it seems it
is, according to
your report).

Hope this helps.

> To my untutored  eye, it looks we're doing the following. [...] Am I
close?

To be honest, I don't think so. At least I don't recognize in your
description the design
I put forth some time ago (and which I had since forgotten until this bug).

João

[1]:
https://www.gnu.org/software/emacs/manual/html_node/flymake/Foreign-and-list_002donly-diagnostics.html