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

Feature Request #549

Closed jstaursky closed 4 years ago

jstaursky commented 4 years ago

Can you make a lisp variable so that the user can set it in emacs to their system includes path and irony will start indexing those system headers that match those listed in the currently open file?

I know you can setup compilation database, set clang-additional-options, etc. but its sort of a pain to do that every time; it would be nice if indexing happened automatically in certain directories. ccls does this but I found it too heavy otherwise.

sten0 commented 4 years ago

I wonder if it would be better to do this per-project with a .dir-locals.el ? https://www.gnu.org/software/emacs/manual/html_node/emacs/Directory-Variables.html

jstaursky commented 4 years ago

Well my point is that the need to specify paths for everything is sort of tedious, especially when I just want to write something short to experiment with a library I just installed or something quick. So the hope is that by specifying the system include path, irony could then intelligently search what you need from your includes. Custom installations or libs requiring finer granularity could then be setup with a .clang-complete file if necessary. The .dir-locals idea would just push the problem somewhere else.

Sarcasm commented 4 years ago

If you want indexing, I would recommend clangd + an lsp package like eglot, or ccls. There is no point implementing a poor indexing in irony-mode, when clangd, rtags, ccls, cquery already implemented it.