[clang-tools-extra] [clangd] Do not offer extraction to variable for decl init expression (PR #69477)

Christian Kandeler via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 19 07:11:52 PST 2024


================
@@ -490,6 +491,13 @@ bool eligibleForExtraction(const SelectionTree::Node *N) {
         BO->getRHS() == OuterImplicit.ASTNode.get<Expr>())
       return false;
   }
+  if (const auto *Decl = Parent->ASTNode.get<VarDecl>()) {
+    if (!Decl->isInitCapture() &&
----------------
ckandeler wrote:

> * "end":{"character":18,"

But that's [[2 + ]]3, no? I get an end character position of 19 with both Qt Creator and VSCode for the [[2 + 3]] selection.

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


More information about the cfe-commits mailing list