]> granicus.if.org Git - clang/commitdiff
Make the cursor kind of macro-name-only completions produced by
authorDouglas Gregor <dgregor@apple.com>
Wed, 25 Aug 2010 18:03:13 +0000 (18:03 +0000)
committerDouglas Gregor <dgregor@apple.com>
Wed, 25 Aug 2010 18:03:13 +0000 (18:03 +0000)
ASTUnit match those produced directly by code completion. Test case is
forthcoming.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112063 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Frontend/ASTUnit.cpp

index a22761d6498d7476315debc6650a44138d1839d3..16aa6e3cc0109bfe4da4f37a110bb8d445df1890 100644 (file)
@@ -1628,6 +1628,7 @@ void AugmentedCodeCompleteConsumer::ProcessCodeCompleteResults(Sema &S,
     
     // Adjust priority based on similar type classes.
     unsigned Priority = C->Priority;
+    CXCursorKind CursorKind = C->Kind;
     CodeCompletionString *Completion = C->Completion;
     if (!Context.getPreferredType().isNull()) {
       if (C->Kind == CXCursor_MacroDefinition) {
@@ -1660,9 +1661,11 @@ void AugmentedCodeCompleteConsumer::ProcessCodeCompleteResults(Sema &S,
       Completion = new CodeCompletionString;
       Completion->AddTypedTextChunk(C->Completion->getTypedText());
       StringsToDestroy.push_back(Completion);
+      CursorKind = CXCursor_NotImplemented;
+      Priority = CCP_CodePattern;
     }
     
-    AllResults.push_back(Result(Completion, Priority, C->Kind, 
+    AllResults.push_back(Result(Completion, Priority, CursorKind, 
                                 C->Availability));
   }