syl20bnr / spacemacs

A community-driven Emacs distribution - The best editor is neither Emacs nor Vim, it's Emacs *and* Vim!
http://spacemacs.org
GNU General Public License v3.0
23.64k stars 4.89k forks source link

Completions don't propagate when requested too fast #11914

Closed next-mad-hatter closed 4 years ago

next-mad-hatter commented 5 years ago

Description :octocat:

In some modes completions don't propagate when requested too fast

Reproduction guide :beetle:

Observed behaviour: :eyes: :broken_heart:

"No matches" message appears and no completions are available, although M-x company-diag does list them:

Emacs 25.3.1 (x86_64-slackware-linux-gnu) of 2017-09-12 on hive64
Company 0.9.9

company-backends: (company-anaconda
 (company-dabbrev-code company-gtags company-etags company-keywords)
 company-files company-dabbrev)

Used backend: company-anaconda
Major mode: python-mode
Prefix: "lam"
Completions:
  #("lambda" 0 1 (struct ["lambda" "keyword" "Lambdas
*******

   lambda_expr        ::= \"lambda\" [parameter_list]: expression
   lambda_expr_nocond ::= \"lambda\" [parameter_list]: expression_nocond

Lambda expressions (sometimes called lambda forms) are used to create
anonymous functions. The expression \"lambda parameters: expression\"
yields a function object.  The unnamed object behaves like a function
object defined with:

   def <lambda>(parameters):
       return expression

See section Function definitions for the syntax of parameter lists.
Note that functions created with lambda expressions cannot contain
statements or annotations." nil nil])) "<keyword>"

The completions stay unavailable at this point until further edits are made.

The time one needs to wait before hitting tab for completions to work is long enough for it to become a persistent problem.

I've tried to reproduce this behaviour in different modes. I've been so far unsuccessful with ruby (rope), clojure (capf) and php (company-ac-php-backend), but now also see this happen with julia-mode and company-keywords.

Expected behaviour: :heart: :smile:

"lam" should get completed to "lambda"

System Info :computer:

Backtrace :paw_prints:

next-mad-hatter commented 5 years ago

In case it's relevant, here profiler report around the attempted completion:

- command-execute                                                 764  56%
 - call-interactively                                             764  56%
  - funcall-interactively                                         764  56%
   + counsel-M-x                                                  581  43%
   + indent-for-tab-command                                       157  11%
   + self-insert-command                                           11   0%
   + evil-mouse-drag-region                                         8   0%
   + evil-open-below                                                5   0%
   + evil-next-line                                                 1   0%
- ...                                                             381  28%
   Automatic GC                                                   381  28%
+ flyspell-post-command-hook                                       66   4%
+ redisplay_internal (C function)                                  43   3%
+ timer-event-handler                                              37   2%
+ evil-escape-pre-command-hook                                     20   1%
+ flycheck-handle-signal                                           12   0%
+ flycheck-perform-deferred-syntax-check                            5   0%
+ url-http-generic-filter                                           3   0%
  tooltip-show-help-non-mode                                        2   0%
+ xselect-convert-to-targets                                        2   0%
+ company-pre-command                                               2   0%
+ eldoc-schedule-timer                                              1   0%
  evil-repeat-post-hook                                             1   0%
  global-hl-line-unhighlight                                        1   0%
+ winner-save-old-configurations                                    1   0%
github-actions[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please let us know if this issue is still valid!