[clang-tools-extra] [clangd] Prefer .hpp files over .h with header source switch (PR #198152)
via cfe-commits
cfe-commits at lists.llvm.org
Tue May 26 07:08:37 PDT 2026
JVApen wrote:
Thanks for the info. I think is is reasonable to make this change. Clangd already favors C++ over C, for example in the includes to standard library it provides. So moving C to the back of the list seems like a reasonable thing to do.
Throwing an alternative in the mix, maybe we should check for all file extensions. If we find more than 1 file matching stem.ext (excluding current file), we should bypass the file based approach.
That way, the symbol approach will be taken and you will correct switching behavior for both stem.c to stem.h and stem.cpp to stem.hpp
(feel free to not implement this if you think it's wrong)
https://github.com/llvm/llvm-project/pull/198152
More information about the cfe-commits
mailing list