Description
I'm facing hangs when company tries to complete something while I typing with big projects. This hangs varies in duration: sometimes hangs are very short, sometimes them last for several seconds. If I type something after company popup appeared I'm facing hang again. When I say hang I mean that if type something I see nothing to happen for some time, chars are being inserted only after completions shown. It makes company totally useless with haskell-mode.
During my investigation I've found that completions for company mode are provided by haskell-process-completions-at-point
function [1] by default. To complete things it calls haskell-process-get-repl-completions
[2], the latter calls haskell-process-queue-sync-request
[3]. Word sync in the function name confuses me a lot. I guess this could be the crux of the matter. I'm not sure, but I suppose haskell-process-queue-command
is async and could be used as replacement.
My current knowledge does not allow me to go any further, but I would be glad to provide a pull request if I'll have some guidance.
Any thoughts?
[1]
Line 59 in 6f2c6c7
[2]
Line 76 in 6f2c6c7
[3]
haskell-mode/haskell-process.el
Line 270 in d6921e8
P.S. I have no good way to test how company performs with other prog-modes and large files, however, I've tried to open 10k LOC jQuery source and tested company with it, having company-idle-delay
set to 0
and company-minimum-prefix-length
set to 2
. In this case completions does not appear instantly, but popup delay was really short, and more important there were no hangs, i.e. I easily can continue typing and see feedback immediately.