3 ms·
> Your language has #ifdef or equivalent syntax which does conditional compilation making syntactic tools incomplete. Your other points make sense, but in this
by School-Cotton 2y ago
> Your language has #ifdef or equivalent syntax which does conditional compilation making syntactic tools incomplete.
Your other points make sense, but in this case, at least for C/C++, you can generate a compile_commands.json that will let clangd interpret your code accurately.
If building with make just do `bear -- make` instead of `make`. If building with cmake pass `-DCMAKE_EXPORT_COMPILE_COMMANDS=1`.
- camel-cdr 2y agoDoes it evaluate macros? Because macros allow for arbitrary computation.
- School-Cotton 2y agoThe macros I see in the real world seem to usually work fine. I’m sure it’s not perfect and you can construct a macro that would confuse it, but it’s a lot better than not having a compilation db at all.