Sarcasm / irony-mode

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

Irony CDB: error in compilation database: wrong-type-argument listp #576

Closed algogavin closed 3 years ago

algogavin commented 3 years ago

I was new to the irony-mode, I followed the instruction to install irony-mode in my emacs, and initially I use .clang_complete file as compilation database, it somehow works -- meaning that the auto-complete works for some of the my classes but not other my classes. So I decide to move to "compile_command.json" way. I had created "comple_command.json" file using waf, and it was placed at $my_project_root/waf_build/obj/ directory, then I use "irony-cdb-json-add-compile-commands-path" [RET] ${my_project_root" [RET] waf_build/obj/compile_command.json [RET] to set the compilation database. Anything seems ok, at least no error so far.

but when I try to do auto-complete on one of my class, it does not show anything. Then I try "company-irony" and it return error with "user-error: Cannot complete at point". Then I try to "iirony-cdb-autosetup-compile-options" but it report error : Irony CDB: error in compilation database: (wrong-type-argument listp "$my_project_root/waf_build/obj/compile_commands.json").

Could some one help me on my configuration issue?

Thanks

algogavin commented 3 years ago

It looks like the compile_commands.json has to be in the "$my_project_root" directory as well. Once it's moved there and re-run the "irony-cdb-json-add-compile-commands-path" followed by "iirony-cdb-autosetup-compile-options", it's working nicely =:)