When code-completion finds a declaration only because it is usable as
the start of a nested-name-specifier, add the "::" after the nested-name-specifier to the code-completion string. llvm-svn: 82587
This commit is contained in:
@@ -313,6 +313,11 @@ void ResultBuilder::MaybeAddResult(Result R, DeclContext *CurContext) {
|
||||
R.QualifierIsInformative = false;
|
||||
}
|
||||
|
||||
// If the filter is for nested-name-specifiers, then this result starts a
|
||||
// nested-name-specifier.
|
||||
if (Filter == &ResultBuilder::IsNestedNameSpecifier)
|
||||
R.StartsNestedNameSpecifier = true;
|
||||
|
||||
// Insert this result into the set of results and into the current shadow
|
||||
// map.
|
||||
SMap.insert(std::make_pair(R.Declaration->getDeclName(),
|
||||
@@ -849,11 +854,13 @@ CodeCompleteConsumer::Result::CreateCodeCompletionString(Sema &S) {
|
||||
return Result;
|
||||
}
|
||||
|
||||
if (Qualifier) {
|
||||
if (Qualifier || StartsNestedNameSpecifier) {
|
||||
CodeCompletionString *Result = new CodeCompletionString;
|
||||
AddQualifierToCompletionString(Result, Qualifier, QualifierIsInformative,
|
||||
S.Context);
|
||||
Result->AddTextChunk(ND->getNameAsString().c_str());
|
||||
if (StartsNestedNameSpecifier)
|
||||
Result->AddTextChunk("::");
|
||||
return Result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user