使用cmake生成compile_commands.json文件,从而clangd能正确识别cmake已经指明的头文件目录 cmake ../src -DCMAKE_EXPORT_COMPILE_COMMANDS=1