I am working on a project that started out using Atmel Studio. It has since been moved to a custom Makefile build and I had trouble getting ccls to reference all files probably.
The solution was to use compiledb to generate a compile_commands.json
file and then add this line
%compile_commands.json
to the .ccls
file in the project root. After that it seems that all references are handled as expected.