Subject: Re: bug#62816: 30.0.50; ElDoc blinks echo area when eldoc-documentation-compose is used

From: João Távora <[email-masked]>
Date: Fri, 14 Apr 2023 00:23:17 +0100

Dmitry Gutov <[email-masked]> writes:

> I still see the problem with window jumping and blinking when typing
> with company-mode enabled, though. You say: "I do use company and
> multi-line echo areas liberally". Do you have some extra configuration
> for company-frontends?

Not that I know of.  I just use a TTY frame.  I don't see it.  The echo
area is frequently empty for me when selecting Eglot completions (in
clangd, the server I most use nowadays).

> 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)
> but I wonder whether some better solution exists.

I hope so.

> OTOH, Eglot implements the attribute which this frontend plugs into
> via :company-docsig, and it seems like both with LSP servers that I
> just tried it returns nil. If the feature is generally unused, I could
> understand if Eglot users all disable this frontend anyway.

I don't think that's the best solution.  Though you're right that only
one server, pyright, uses this (it's some user's hack in eglot.el I let
through: I don't even know what it does, i think it tells)

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?

Another option is just to temporarily disable eldoc during the duration
of the Company completion session.  

I think Company could/should do both of these things, but I haven't
studied the problem so I might be missing something.

João