[cfe-dev] code completion macros show private stuff

Willy WOLFF via cfe-dev cfe-dev at lists.llvm.org
Mon Sep 28 09:22:07 PDT 2015

Hi all,

Regarding the code completion macros tool; by default, this tool, when
asked for completing a method or an attribute, it proposes all
possibilities, whatever it is declared public or private.

Would it not be more interesting to show only correct completion by
default? Or at least, give this information.

I've modified locally the tool to do so:
$ svn diff
Index: CodeCompleteConsumer.cpp
--- CodeCompleteConsumer.cpp (revision 248706)
+++ CodeCompleteConsumer.cpp (working copy)
@@ -437,6 +437,10 @@

   // Print the results.
   for (unsigned I = 0; I != NumResults; ++I) {
+    if ((Results[I].Availability == CXAvailability_NotAvailable) ||
+        (Results[I].Availability == CXAvailability_NotAccessible))
+      continue;
     OS << "COMPLETION: ";
     switch (Results[I].Kind) {
     case CodeCompletionResult::RK_Declaration:

Best Regards,

More information about the cfe-dev mailing list