Eigen3's header files are non-self-contained, so clangd can print lots of errors.
@Nysander on Discord proposed a solution:
I managed to get clangd working while editing Eigen itself by generating the
compile_commands.jsonwithcmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_CXX_FLAGS="-I$(git rev-parse --show-toplevel)"and the following.clangdfile.If: PathMatch: .*Eigen/src/.* CompileFlags: