if the definition you are looking for is not part of the “loaded” files, you got 3 options:
- clangd failed to index the relevant translation unit
- clangd is still indexing, and hasn’t made it to the particular file yet
- the file is not part of your compile_commands.json
you can verify the first two by passing
-log=verbose to clangd and searching the looks for the name of the file you are looking for and check for the last one by searching for the name in the compile_commands.json instead.
if it is the first one, we can’t really help much without the code + compile commands for that file.
if it is the second, you just need to wait
if it is the last one, you need to figure out why your build system(or compile commands generator) doesn’t include that file in the database.