I’m trying to set up a development environment for my C++ project, including IDE integration. I’m currently flexible on which IDE to use, but am actively looking at CLion and VSCode. If it matters, I am working on a Mac and using Nix-Darwin.
So far, I have set up a
shell.nix in my development directory to pull in compile dependencies, and also added a direnv
.envrc file to automatically load it. This works flawlessly for CMake based builds (I can just cd into
projectDir/build and invoke
cmake ../ and we are good). And VSCode, with its direnv extension, does this automatically too! Perfect so far.
However, I’m wondering if/how I can extend this beauty to my IDE editor, so it can “see” the header files provided by dependencies, and thus offer real autocomplete and analysis on types they provide.
My understanding on this whole thing is vague, so please correct me if I’m wrong. But I think the compiler is able to find these files only because the
clang-wrapper script adds them when the compiler is invoked. Is there a way to help the IDE see them too? If this is possible, Nix as a development platform will be amazing!