Here's a screencast that demonstrates the problem:
https://a.uguu.se/csTMrzxc.webm
Ugh, that indeed looks awful. We must fix it.
One way to fix that is
(push 'company-echo-metadata-frontend company-frontends)
Sorry, that was supposed to be (delete ...). The one above restores
the configuration -- I needed it for a repeat comparison.
Ahaha :-) No, no, I did exactly the same and misquoted you. I put the
push there to restore it, with a quick C-x C-e. You did send the delq.
But, perhaps to ask the obvious, why can't Company just detect when nil
is passed to it via :company-docsig and not do any echoing in that
situation? Isn't it Company doing the clearing we want to avoid?
I think it does need to clear the echo area when it was previously
echoed to by the same backend (showing meta from a different
completion). E.g. after the user just presses C-n with completion
popup already visible. So the idea to "just not do any echoes" would
require some bookkeeping about where the current message came from,
compare the current message contents, and possibly still fail
sometimes where the exact same message came from a different
source. The last one is unlikely, though.
I see. Eglot only uses one Company source, company-capf, if that helps.
Another option is just to temporarily disable eldoc during the duration
of the Company completion session.
Right.
And yet another solution would be to detect that Eldoc will be used,
and try to plug into its documentation functions to display the meta
thingy alongside the other info.
That's at least 3 potential solutions now.
I think you should do the "bookkeeping" one, at least a very simple
version. Just record in your concept of a "company session" if there
was ever a non-nil :company-docsig sent from anywhere that required
echoing. Until there is, never clear on nil :company-docsig.
Eventually, if there is something to echo, tough luck: display it and
proceed as currently, clearing always on nil, risking flickering.
Suspect this should fix 95% of the cases, certainly Eglot usages.