Holy crap, Clang can do code completion inside a macro body, when the context is dependent on a macro parameter...
10 plus ones
Shared publicly•View activity
View 4 previous comments
- There are probably several different Emacs plugins for it, irony-mode being one of them. :)6w
- Now I have to figure out how to configure irony-mode to invoke clang with C++11 (well, C++17 preferably) turned on.6w
- - Usually there's some way to specify a list of flags as if they were being passed on the clang command line.6w
- Yeah, the way that's supposed to work (.clang_arguments file at the project root) doesn't seem to. Irony seems to see it, but somehow the arguments don't get passed to company-clang. I managed to manhandle it by setting the variable company-clang-arguments to contain what I want. But, well, that is manhandling it. That sets them globally and not at all automatically.
But, it works! And my sparkles library makes a mockery of it because of the way it plays with function and argument types. :-)6w
- Seems like there should be a magic plug-in which causes clang to write out flags during the build, which the completion side can be configured to use automatically.
[I have no idea if there is such a thing. It just seems sensible enough that I'd poke around for it before spending too much time trying to match flags manually.]6w
- I, too, am curious about the specific editor and build system combination that exposes this. At work we use Clang, and a makefile-based codebase that I edit with Emacs. I use RTags to leverage* Clang for code browsing, and YCMd for code completion, though really with a C codebase the latter is not very useful. I'm always curious to know what else I can add.
*Yeah I said it6w