Closed SnowinterCat closed 3 months ago
I've found the reason, it's because clangd in llvm version 18.1.8 doesn't support -std:c++latest yet, it has nothing to do with the compile command. When I use c++20, clangd is able to analyze the header files properly.
Is your feature request related to a problem? Please describe.
When I use clangd as a analyzer, I find that the source files are analyzed properly. But unfortunately, the header files are all reporting errors inside the header files. I looked up the documentation related to clangd and learned that it is the lack of a header file compilation method in the compile_command that prevents clangd from analyzing it. But it's true that normal header files don't need to be compiled, only qt projects need to compile header files.So the qt header in QtCreator works fine with clangd, because QtCreater generates the compile command for its header files. Is there any way to add a rules so that normal header files also generate a compile command, like QtCreater does for its header files?
Describe the solution you'd like
Perhaps we could add a rule that allows header files to be put into add_files, generating compile_commands, but not using the compiler to compile them. Or maybe modify this rule: "plugin.compile_commands.autoupdate". Add a parameter to it to support generating compile_commands for header files?
Describe alternatives you've considered
No response
Additional context
No response