[clang-tools-extra] [clangd] Prefer .hpp files over .h with header source switch (PR #198152)
Aleksandr Platonov via cfe-commits
cfe-commits at lists.llvm.org
Tue May 26 02:06:40 PDT 2026
https://github.com/ArcsinX approved this pull request.
I think this patch makes sense, because `getCorrespondingHeaderOrSource()` is also used in the `DefineOutline` tweak. Without this patch, the priority of extensions is a little strange (cpp=>c=>cc), i.e. without this patch, when we move the definition from the header, if there are `.c` and `.cc` files with the same basename, then priority is given to `.c`, but if there is `.cpp`, then priority is given to `.cpp`. So, the logic as a whole is not very clear.
With this patch there is at least a consistent pattern that priority is given to C++ file extensions.
https://github.com/llvm/llvm-project/pull/198152
More information about the cfe-commits
mailing list