emacsorphanage / company-jedi

Company backend for Python jedi
101 stars 12 forks source link

Problems when group company-jedi with other backend #16

Open Yevgnen opened 8 years ago

Yevgnen commented 8 years ago

Hi,

I find that when I use a grouped backend like '((company-jedi company-files company-gtags company-etags company-keywords) company-dabbrev), the company candidate menu flashes quite often each time I type a single char. But ((company-jedi company-gtags company-etags company-keywords) company-dabbrev) or use the single backend company-jedi perform just quite well.

I first guess that company-jedi conflicts with the company-files. But soon after I find that '((company-jedi company-yasnippet company-gtags company-etags company-keywords) company-dabbrev) causes the same problem.

Is that a company-jedi issue ?

Any help will be appreciated :)

syohex commented 8 years ago

Could you show me sample code for reproducing this issue ?

Yevgnen commented 8 years ago

I simply write a config look like

(require 'package)

(setq package-archives '(("marmalade" . "http://marmalade-repo.org/packages/")
                         ("gnu" . "http://elpa.gnu.org/packages/")
                         ("melpa" . "https://melpa.org/packages/")
                         ("org" . "http://orgmode.org/elpa/")))

(package-initialize)

(unless (and (file-exists-p (expand-file-name "elpa/archives/marmalade" user-emacs-directory))
             (file-exists-p (expand-file-name "elpa/archives/gnu" user-emacs-directory))
             (file-exists-p (expand-file-name "elpa/archives/melpa" user-emacs-directory))
             (file-exists-p (expand-file-name "elpa/archives/org" user-emacs-directory)))
  (package-refresh-contents))

(unless (package-installed-p 'use-package)
  (package-refresh-contents)
  (package-install 'use-package))

(require 'use-package)

(package-install 'company)
(package-install 'jedi-core)
(package-install 'company-jedi)

(require 'company)
(require 'jedi-core)
(require 'company-jedi)

(global-company-mode)
(add-hook 'python-mode-hook
          (lambda ()
            (setq company-backends '((company-jedi
                                      company-yasnippet ;; Comment out this line and the follow one should find some differences 
                                      company-files ;; 
                                      company-dabbrev-code
                                      company-gtags
                                      company-etags
                                      company-keywords)
                                     company-dabbrev))))

to test. Ugly, but should show the issue.

Normal: Normal

Abnormal: 3

failable commented 8 years ago

Any news of this ?

syohex commented 8 years ago

Sorry no news. I'll try to check in this week.

syohex commented 8 years ago

I confirmed this issue. I suppose that because company-jedi is asynchronous backend. I confirm this behavior company-clang which is asynchronous backend too. So asynchronous backend should not be grouped if you does not want this behavior.

BTW this behavior is not occurred with manual completion as below.

(custom-set-variables
 '(company-idle-delay nil))
Yevgnen commented 8 years ago

What a pity!

gonewest818 commented 4 years ago

Leaving a "documentation" on this, and I suppose we should test behavior on current Emacs builds.