So ccls is a lsp wrapper for clang
it works as a backend that indexes source code and gives emacs index information for better navigation and refactoring of c++
I have had a few issues with the tool’s setup in emacs enviroment. and found the following things that may need extra attention
- .cclsfile, this file basically does two things
- tell cclshow to index the file usingclang
- before index the file tell clanghow to compile and interpret the code as there is a mixture of options forcclsand arguments forclang, need to pay extra attention
usually lines in .ccls file start with % is for ccls, and lines start with - is for clang
- c and c++ code/mode, it is better to set only for c++ as c++ is a super set of c 
- company completion of header files should work without input the surrounds of header file e.g, - ""or- <>
- some times ccls complains it cannot find header file, so you may include the root path of the header files by adding - -IincludePathto- .cclsfiles
- for large projects using - compile_commands.jsonto guide- cclsindexing. you may of course set partial folder for index by setting the black list ow white list if indexing is way too slow
- setting key bindings in emacs, the priority is: - local-settings > global-settings > define-key