[clang-tools-extra] Follow style configuration in clangd when inserting missing includes (PR #140594)
kadir çetinkaya via cfe-commits
cfe-commits at lists.llvm.org
Tue May 27 13:06:24 PDT 2025
================
@@ -151,6 +164,11 @@ std::vector<Diag> generateMissingIncludeDiagnostics(
if (!Replacement.has_value())
continue;
+ if (Angled && Spelling.front() == '\"') {
----------------
kadircet wrote:
yikes, we also need to do this transformation in the other way as well :/
Might be easier to:
```cpp
if (Angled != (Spelling.front() == '<')) {
Spelling.front() = Angled ? '<' : '"';
Spelling.back() = Angled ? '>' : '"';
}
```
(I guess we're also lacking some tests for the quoted direction)
https://github.com/llvm/llvm-project/pull/140594
More information about the cfe-commits
mailing list