diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-08-25 18:41:16 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-08-25 18:41:16 +0000 |
commit | 721f359a350059a81945baa08f63b2e5feceb044 (patch) | |
tree | 48f2502b9bee43cc09c17139cf317c77fea5366a /lib/Frontend/ASTUnit.cpp | |
parent | 8bea82f6699e4384ef823cdc8800ad5db271177c (diff) |
When combining the code-completion results from Sema long with the
code-completion results cached by ASTUnit, sort the resulting result
set. This makes testing far, far easier, so this commit also includes
tests for the previous few fixes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112070 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/ASTUnit.cpp')
-rw-r--r-- | lib/Frontend/ASTUnit.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/Frontend/ASTUnit.cpp b/lib/Frontend/ASTUnit.cpp index 31e42a3c36..452803acd2 100644 --- a/lib/Frontend/ASTUnit.cpp +++ b/lib/Frontend/ASTUnit.cpp @@ -1552,8 +1552,10 @@ void CalculateHiddenNames(const CodeCompletionContext &Context, case CodeCompletionContext::CCC_MacroName: case CodeCompletionContext::CCC_MacroNameUse: case CodeCompletionContext::CCC_PreprocessorExpression: + case CodeCompletionContext::CCC_PreprocessorDirective: case CodeCompletionContext::CCC_NaturalLanguage: - // If we're just looking for protocol or macro names, nothing can hide them. + // We're looking for nothing, or we're looking for names that cannot + // be hidden. return; } @@ -1676,7 +1678,9 @@ void AugmentedCodeCompleteConsumer::ProcessCodeCompleteResults(Sema &S, Next.ProcessCodeCompleteResults(S, Context, Results, NumResults); return; } - + + // Sort the completion results before passing them on to the actual consumer. + std::stable_sort(AllResults.begin(), AllResults.end()); Next.ProcessCodeCompleteResults(S, Context, AllResults.data(), AllResults.size()); |