company-mode / company-quickhelp

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

Does not work along with company-complete #113

Open avatar-lavventura opened 3 years ago

avatar-lavventura commented 3 years ago

I was not able to make it work, what may be the reason? C-c h is not triggered as well.

my config file:

(company-quickhelp-mode)

(eval-after-load 'company
  '(define-key company-active-map (kbd "C-c h") #'company-quickhelp-manual-begin))

(setq company-auto-complete t)

(eval-after-load 'company
  '(progn
     (define-key company-active-map (kbd "TAB") 'company-complete-common-or-cycle)
     (define-key company-active-map (kbd "<tab>") 'company-complete-common-or-cycle)))

(setq company-frontends
      '(company-pseudo-tooltip-unless-just-one-frontend
        company-preview-frontend
        company-echo-metadata-frontend))

(setq company-auto-complete t)
(global-set-key (kbd "C-c C-k") 'company-complete)
dgutov commented 3 years ago

Does company-show-doc-buffer work? It's normally bound to C-h while the completion is active.

If it does not, the current backend does not support to documentation display. You can find out the currently used backend with M-x company-diag.

avatar-lavventura commented 3 years ago

M-x company-show-doc-buffer returns:

abs(n: SupportsAbs[_T], /) -> _T

Return the absolute value of the argument.

C-h is bind to delete a character on my end; while completion is active, C-h deletes a character.

Output of M-x company-diag; my current backend: https://gist.github.com/avatar-lavventura/c37df6f9f35e377c89d880f9be9ec664

dgutov commented 3 years ago

OK.

Please clarify: does it work with other backends? In .el files, for instance.

avatar-lavventura commented 3 years ago

I am not sure it does not do work do anything, maybe I was not able to make proper init.el file.

Is there any .emacs configurations that I can try, which works on your end?

dgutov commented 3 years ago

Here's the problem: you're resetting the value of company-frontends after enabling company-quickhelp-mode. Thereby undoing the effect of that function.

Do it in the reverse: move (company-quickhelp-mode) to the last line.

avatar-lavventura commented 3 years ago

ah I tried it but I does not work :-(


updated .emacs:

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

(add-to-list 'package-archives
             '("MELPA Stable" . "http://stable.melpa.org/packages/") t)

(package-initialize)

(when (not package-archive-contents)
  (package-refresh-contents))

(if (not (package-installed-p 'company-quickhelp))
    (progn
      (package-install 'company-quickhelp)))

(add-hook 'after-init-hook 'global-company-mode)
(setq company-auto-complete t)

(setq company-auto-complete t)
(global-set-key (kbd "C-c C-k") 'company-complete)

(company-quickhelp-mode)  ;; moved to the end of the file

(eval-after-load 'company
  '(define-key company-active-map (kbd "C-c h") #'company-quickhelp-manual-begin))
dgutov commented 3 years ago

ah I tried it but I does not work :-(

Does it work in emacs-lisp-mode? Or in *scratch*?

avatar-lavventura commented 3 years ago

Like I only used text code on my previoes comment in .emacs file and deleted all the other stuff but there was no affect.

dgutov commented 3 years ago

Could you rephrase that? I'm not sure I understand you well.

avatar-lavventura commented 3 years ago

Sorry I am just unable to make it work.

dgutov commented 3 years ago

It doesn't work in *scratch* either?

Are you using a graphical Emacs? Not in terminal?