[clang-tools-extra] [clangd] Fix header-name completion replace ranges (PR #225473)

Aleksandr Platonov via cfe-commits cfe-commits at lists.llvm.org
Sat Oct 3 01:07:22 PDT 2026


================
@@ -1834,9 +1834,12 @@ class CodeCompleteFlow {
     }
 
     if (Opts.EnableInsertReplace) {
-      ReplaceRange.emplace();
-      ReplaceRange->start = InsertRange.start;
-      ReplaceRange->end = getEndOfCodeCompletionReplace(SM);
----------------
ArcsinX wrote:

nit: maybe just `ReplaceRange->end = (CCContextKind == CCC_IncludedFile) ? InsertRange.end : getEndOfCodeCompletionReplace(SM);`?

Setting `ReplaceRange` to `InsertRange` and immediately overriding `ReplaceRange->end` looks a bit strange.

https://github.com/llvm/llvm-project/pull/225473


More information about the cfe-commits mailing list