Use an Emacs directory-local variable to specify to ccls where the compilation directory lives, tell CMake to generate the compilation database, and remove bear from the environment. Add clang to the environment for clang-format.
I don’t think this should ever have been added.