Skip to content

Company mode hangs Emacs when looking up for candidates. #606

Closed
@geraldus

Description

@geraldus

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]

(defun haskell-process-completions-at-point ()

[2]
(haskell-process-get-repl-completions process text))))

[3]
(rawstr (haskell-process-queue-sync-request process reqstr)))

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions