company-mode / company-quickhelp

Documentation popup for Company
GNU General Public License v3.0
374 stars 33 forks source link

documentation popup delay seems off by factor of 10 #120

Open rutenkolk opened 3 years ago

rutenkolk commented 3 years ago

I use company-quickhelp via the cider layer in spacemacs.

However I noticed that there is an annoyingly long delay between selecting an autocomplete suggestion and the documentation popping up.

I looked at the customize-group company-quickhelp menu and found out that the delay was supposed to be 0.5 seconds.

However when I timed it before, it seemed to be around 4 to 5 seconds.

I thought that maybe fetching the javadoc just takes so long and adjusting this would not do anything but to my surprise it does.

I have now adjusted my .spacemacs config as follows:

(defun dotspacemacs/emacs-custom-settings ()
  "Emacs custom settings.
This is an auto-generated function, do not modify its content directly, use
Emacs customize menu instead.
This function is called at the very end of Spacemacs initialization."
(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(company-quickhelp-delay 0.02)

...

This makes the documentation pop up almost immediately and is a functioning workaround for me.

Nevertheless, this seems unintended. I have no idea if this is a company bug, or spacemacs oddity, or if the assumption that the units are in seconds is wrong, so forgive me if this is the wrong repo to post this issue.

dgutov commented 3 years ago

Hi!

Any chance you have a step-by-step reproduction for this with vanilla Emacs? Without spacemacs, that is.

It seems to work okay with the default value of 0.5 over here, without any 4-5 second delays.

The scenario could start like this: emacs -Q -L ~/.emacs.d/elpa/company-xxx -L ~/.emacs.d/elpa/company-quickhelp-yyy -L ~/.emacs.d/elpa/pos-tip-20191227.1356/ -l company -l company-quickhelp.

Also try it in a *scratch* buffer first. It would be using the completion function set up in there (one for Emacs Lisp). If it works better in some buffers than others, that would indicate a problem with the used backend. Unlikely, though.

If that sounds too difficult, you can first report the problem to Spacemacs bug tracker and/or try Doom and see whether it has the same problem.

rutenkolk commented 3 years ago

Hi, thanks for the fast reply.

I've never done anything with vanilla emacs before, just to prefix this, but i can try. might take me a while though

dgutov commented 3 years ago

Let me know how it goes, I can give some extra recommendations along the way.