diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-01-13 23:24:38 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-01-13 23:24:38 +0000 |
commit | ab0b4f1d66de54b4c3102b96d56964510361ba7d (patch) | |
tree | 60d687f855f2cf67dc371ebdade2b1315330ceff /lib/Sema/CodeCompleteConsumer.cpp | |
parent | cefd3ada97faf5a759dac4705900053d3aa071e9 (diff) |
Improve the sorting of code-completion results. We now always sort by
the "typed" text, first, then take into account
nested-name-specifiers, name hiding, etc. This means that the
resulting sort is actually alphabetical :)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93370 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/CodeCompleteConsumer.cpp')
-rw-r--r-- | lib/Sema/CodeCompleteConsumer.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/Sema/CodeCompleteConsumer.cpp b/lib/Sema/CodeCompleteConsumer.cpp index 0a00b4226d..fbd14502b7 100644 --- a/lib/Sema/CodeCompleteConsumer.cpp +++ b/lib/Sema/CodeCompleteConsumer.cpp @@ -426,8 +426,7 @@ PrintingCodeCompleteConsumer::ProcessCodeCompleteResults(Sema &SemaRef, OS << "COMPLETION: "; switch (Results[I].Kind) { case Result::RK_Declaration: - OS << Results[I].Declaration->getNameAsString() << " : " - << Results[I].Rank; + OS << Results[I].Declaration->getNameAsString() ; if (Results[I].Hidden) OS << " (Hidden)"; if (CodeCompletionString *CCS @@ -440,13 +439,13 @@ PrintingCodeCompleteConsumer::ProcessCodeCompleteResults(Sema &SemaRef, break; case Result::RK_Keyword: - OS << Results[I].Keyword << " : " << Results[I].Rank << '\n'; + OS << Results[I].Keyword << '\n'; break; case Result::RK_Macro: { - OS << Results[I].Macro->getName() << " : " << Results[I].Rank; + OS << Results[I].Macro->getName(); if (CodeCompletionString *CCS - = Results[I].CreateCodeCompletionString(SemaRef)) { + = Results[I].CreateCodeCompletionString(SemaRef)) { OS << " : " << CCS->getAsString(); delete CCS; } @@ -455,7 +454,7 @@ PrintingCodeCompleteConsumer::ProcessCodeCompleteResults(Sema &SemaRef, } case Result::RK_Pattern: { - OS << "Pattern : " << Results[I].Rank << " : " + OS << "Pattern : " << Results[I].Pattern->getAsString() << '\n'; break; } |