I’m a novice at C and very new to C tooling, so bear with me if this is a dumb issue.
I use neovim + coc with clangd as my lsp to work in C. Right now I’m trying to use this setup to work in suckless org projects like dwm which consist of large .c files, configuration header files which are included well into the file, and a Makefile to build everything.
I can get LSP features to work just fine in the .c files by running a tool called “bear” to generate compiler_commands.json so that clangd knows about the libraries referenced in those files. But these configuration header files reference types that are defined before the header files are included. As a result, when I open the header files, clangd gives a bunch of unknown_typename errors.
Is there any way I can get rid of the unknown_typename errors when viewing these header files but benefit from LSP features? I don’t believe those header files are complete translation units so I don’t think I can make a compiler_commands entry for them, but I was hoping someone could give me some advice (and maybe a sanity check on whether this makes sense to do). Thanks in advance.