Andersbakken / rtags

A client/server indexer for c/c++/objc[++] with integration for Emacs based on clang.
http://www.rtags.net
GNU General Public License v3.0
1.83k stars 254 forks source link

Report error after find invalid options #1378

Closed zhihuiFan closed 3 years ago

zhihuiFan commented 4 years ago

Is your feature request related to a problem? Please describe. Right now, the issue I am facing is when I run rtags-find-sysbol and type some prefix then tab, I can't get any auto completion. usually I can.
some days ago, my autocompleted doesn't work for aStruct->, the final reason probably there are some gcc options which clang doesn't know. anyway, I didn't change any emacs settings, the issue gone.

So this requests is for a feature that rdm can auto detect some invalid settings in compile_commands.json, for example: there are 2 entires for the same file or there are some complier options for clang in compile_commands, so that user can fix it quickly.

Describe the solution you'd like

rdm --validate_cmdb will reports all the issue like above.

Thank you for this project always!

zhihuiFan commented 4 years ago

BTW, My emacs configuration for rtags is not changed for a very long time, but some times the rtags-diagnostics can work automatically (means when I am typing, it show me the something wrong in time), but some times, it can't. However the rtags-compile-file can still work (and only one line for this file in compile_commands.json. What maybe the reason?

Thanks

zhihuiFan commented 3 years ago

So this requests is for a feature that rdm can auto detect some invalid settings in compile_commands.json, for example: there are 2 entires for the same file or there are some complier options for clang in compile_commands, so that user can fix it quickly.

The easiest way to detect invalid options is change the "gcc" to "clang" in compile_commands.join, and run rtags-compile-file command. we will get an clear error if we have one.

Another way to avoid such situation is just use clang to compile our software. that's the way I'm using now.