I'm a new Emacs user, and want to get autocompletion in C using irony-mode.
I installed elpa-irony
using apt, as well as irony-server
using apt, as the CMake compilation fails.
I added these lines to the bottom to my .emacs file:
(add-hook 'c++-mode-hook 'irony-mode)
(add-hook 'c-mode-hook 'irony-mode)
(add-hook 'objc-mode-hook 'irony-mode)
(add-hook 'irony-mode-hook 'irony-cdb-autosetup-compile-options)
I created this compilatation database using clang -MJ
:
[
{ "directory": "/home/foo/coding/EIPA/Assembler", "file": "main.c", "output": "/tmp/main-49804d.o", "arguments": ["/usr/lib/llvm-15/bin/clang", "-xc"\
, "main.c", "-o", "/tmp/main-49804d.o", "-Wall", "-Wextra", "--target=x86_64-pc-linux-gnu"]}
]
and placed it in the "Project" directory. I ran M-x irony-cdb-autosetup-compile-options
and M-x irony-cdb-menu
shows the compile options correctly.
However, when I edit my C file, I don't see any autosuggestions. Do I need to press something to bring them up or can I verify that irony-mode and irony-server are on? Or can I also see if Emacs is correctly recognizing my file as a C file (my file has .c extention)?