[clang] [clang-tools-extra] [clangd] Autocomplete fixes for methods (PR #165916)

Nathan Ridge via cfe-commits cfe-commits at lists.llvm.org
Sat Mar 7 23:07:21 PST 2026


================
@@ -1777,20 +1800,31 @@ class CodeCompletionDeclConsumer : public VisibleDeclConsumer {
     this->BaseType = BaseType;
   }
 
+  void setIsInDeclarationContext(bool IsInDeclarationContext) {
+    this->IsInDeclarationContext = IsInDeclarationContext;
+  }
+
+  void setIsAddressOfOperand(bool isAddressOfOperand) {
+    IsAddressOfOperand = isAddressOfOperand;
+  }
+
   void FoundDecl(NamedDecl *ND, NamedDecl *Hiding, DeclContext *Ctx,
                  bool InBaseClass) override {
     ResultBuilder::Result Result(ND, Results.getBasePriority(ND),
                                  /*Qualifier=*/std::nullopt,
                                  /*QualifierIsInformative=*/false,
                                  IsAccessible(ND, Ctx), FixIts);
-    Results.AddResult(Result, InitialLookupCtx, Hiding, InBaseClass, BaseType);
+    Results.AddResult(Result, InitialLookupCtx, Hiding, InBaseClass, BaseType,
+                      IsInDeclarationContext, IsAddressOfOperand);
   }
 
   void EnteredContext(DeclContext *Ctx) override {
     Results.addVisitedContext(Ctx);
   }
 
 private:
+  bool IsInDeclarationContext;
----------------
HighCommander4 wrote:

nit: please place new fields of this class next to the existing fields at the top

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


More information about the cfe-commits mailing list