aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Sema/CodeCompleteConsumer.cpp
diff options
context:
space:
mode:
authorEric Liu <ioeric@google.com>2018-10-24 12:57:27 +0000
committerEric Liu <ioeric@google.com>2018-10-24 12:57:27 +0000
commit4a7cd63795b4ffbb6cdeef19a736adc873ab8ada (patch)
tree5f81a2d4efa29c19485446ee4ba11794c0e40937 /clang/lib/Sema/CodeCompleteConsumer.cpp
parent40d5684d41ee69353a91aef34a0ff47b91e24c7e (diff)
downloadllvm-4a7cd63795b4ffbb6cdeef19a736adc873ab8ada.zip
llvm-4a7cd63795b4ffbb6cdeef19a736adc873ab8ada.tar.gz
llvm-4a7cd63795b4ffbb6cdeef19a736adc873ab8ada.tar.bz2
[CodeComplete] Expose InBaseClass signal in code completion results.
Summary: No new tests as the existing tests for result priority should give us coverage. Also as the new flag is trivial enough, I'm reluctant to plumb the flag to c-index-test output. Reviewers: ilya-biryukov Reviewed By: ilya-biryukov Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D53635 llvm-svn: 345135
Diffstat (limited to 'clang/lib/Sema/CodeCompleteConsumer.cpp')
-rw-r--r--clang/lib/Sema/CodeCompleteConsumer.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/clang/lib/Sema/CodeCompleteConsumer.cpp b/clang/lib/Sema/CodeCompleteConsumer.cpp
index 754169fe..2058f36 100644
--- a/clang/lib/Sema/CodeCompleteConsumer.cpp
+++ b/clang/lib/Sema/CodeCompleteConsumer.cpp
@@ -548,13 +548,18 @@ PrintingCodeCompleteConsumer::ProcessCodeCompleteResults(Sema &SemaRef,
switch (Results[I].Kind) {
case CodeCompletionResult::RK_Declaration:
OS << *Results[I].Declaration;
- if (Results[I].Hidden)
- OS << " (Hidden)";
- if (CodeCompletionString *CCS
- = Results[I].CreateCodeCompletionString(SemaRef, Context,
- getAllocator(),
- CCTUInfo,
- includeBriefComments())) {
+ {
+ std::vector<std::string> Tags;
+ if (Results[I].Hidden)
+ Tags.push_back("Hidden");
+ if (Results[I].InBaseClass)
+ Tags.push_back("InBase");
+ if (!Tags.empty())
+ OS << " (" << llvm::join(Tags, ",") << ")";
+ }
+ if (CodeCompletionString *CCS = Results[I].CreateCodeCompletionString(
+ SemaRef, Context, getAllocator(), CCTUInfo,
+ includeBriefComments())) {
OS << " : " << CCS->getAsString();
if (const char *BriefComment = CCS->getBriefComment())
OS << " : " << BriefComment;