0

I am trying to get completion to work with company-clang. In particular, I would like to get completion candidates that are from header files that I provide with

dir-locals.el

When I look at the buffer clang-output. I can see the correct completion candidates.

However, in the code itself I only get the message

no completion found

Any idea what I am doing wrong? I follow the standard advice for setting up company.

My setup in .emacs

(require 'company)
(add-hook 'after-init-hook 'global-company-mode)
(require 'cc-mode)
(define-key c-mode-map  (kbd "<tab>") 'company-complete)
(define-key c++-mode-map (kbd "<tab>") 'company-complete)

Using M-x company-diag I get

Emacs 26.1 (x86_64-apple-darwin14.5.0) of 2018-05-28 on builder10-10.porkrind.org
Company 0.9.9

company-backends: (company-irony company-clang company-xcode company-ropemacs company-cmake company-capf company-ob-ipython
           (company-dabbrev-code company-gtags company-etags company-keywords))
Used backend: company-clang
Major mode: c++-mode
Prefix: #("gsl_e" 0 1
  (fontified t)
  1 2
  (fontified t)
  2 3
  (fontified t)
  3 4
  (fontified t)
  4 5
  (fontified t))

Completions: none
  • 1
    post your company and clang setup/config. otherwise there is nothing to inspect for errors. Also provide a link to the setup guide that you followed. – A_P Feb 15 at 22:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.