Sarcasm / irony-mode

A C/C++ minor mode for Emacs powered by libclang
GNU General Public License v3.0
901 stars 98 forks source link

Can't make irony mode work on Manjaro #564

Open louhmmsb opened 3 years ago

louhmmsb commented 3 years ago

I'm trying for several hours to make irony's autocomplete work but I keep getting the following error Irony I/O task: error in callback: (irony-server-error complete-error "failed to perform code completion". I think I'm setting things up wrong, sorry I'm pretty new to this. Besides the cpp file, what should I have in the folder, and how do i know if irony is being able to locate libclang?

The relevant part of my init.el is

` (use-package company :ensure t :config (setq company-idle-delay 0) (setq company-minimum-prefix-length 3))

 (use-package company-irony
   :ensure t
   :config
   (require 'company)
   (add-to-list 'company-backends 'company-irony))

 (use-package irony
   :ensure t
   :config
   (add-hook 'c++-mode-hook 'irony-mode)
   (add-hook 'c-mode-hook 'irony-mode)
   (add-hook 'irony-mode-hook 'irony-cdb-autosetup-compile-options))

 (with-eval-after-load 'company
   (add-hook 'c++-mode-hook 'company-mode)
   (add-hook 'c-mode-hook 'company-mode))

`

Sasanidas commented 3 years ago

It is not recommended to use require inside use-package , use :after or :require instead (use-package), also you can set up hook with use-package too (hooks).

Did you run irony-install-server? If it is the case, check the version of the irony server, and try to parse some file with the command line (with the default location): ~/.emacs.d/irony/bin/irony-server parse FILE If all is correct, try to autocomplete with the interactive mode

Good luck!