diff options
| author | Douglas Gregor <dgregor@apple.com> | 2010-08-23 18:23:48 +0000 |
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2010-08-23 18:23:48 +0000 |
| commit | c49f5b2f111cad4596ed285bae771f62a25bd9e7 (patch) | |
| tree | d9bb3f286ce874ae344bdf3de1ae75f527297805 /clang/lib/Frontend | |
| parent | 08fd2cf26a2363bd3192f1280976724869359ef1 (diff) | |
| download | bcm5719-llvm-c49f5b2f111cad4596ed285bae771f62a25bd9e7.tar.gz bcm5719-llvm-c49f5b2f111cad4596ed285bae771f62a25bd9e7.zip | |
Introduce a new code-completion point when we're parsing a
declarator. Here, we can only see a few things (e.g., cvr-qualifiers,
nested name specifiers) and we do not want to provide other non-macro
completions. Previously, we would end up in recovery mode and would
provide a large number of non-relevant completions.
llvm-svn: 111818
Diffstat (limited to 'clang/lib/Frontend')
| -rw-r--r-- | clang/lib/Frontend/ASTUnit.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/clang/lib/Frontend/ASTUnit.cpp b/clang/lib/Frontend/ASTUnit.cpp index 9aa9f5b6cca..c7d47309cfe 100644 --- a/clang/lib/Frontend/ASTUnit.cpp +++ b/clang/lib/Frontend/ASTUnit.cpp @@ -235,7 +235,8 @@ void ASTUnit::CacheCodeCompletionResults() { | (1 << (CodeCompletionContext::CCC_EnumTag - 1)) | (1 << (CodeCompletionContext::CCC_UnionTag - 1)) | (1 << (CodeCompletionContext::CCC_ClassOrStructTag - 1)) - | (1 << (CodeCompletionContext::CCC_Type - 1)); + | (1 << (CodeCompletionContext::CCC_Type - 1)) + | (1 << (CodeCompletionContext::CCC_PotentiallyQualifiedName - 1)); if (isa<NamespaceDecl>(Results[I].Declaration) || isa<NamespaceAliasDecl>(Results[I].Declaration)) @@ -275,7 +276,10 @@ void ASTUnit::CacheCodeCompletionResults() { | (1 << (CodeCompletionContext::CCC_ClassStructUnion - 1)) | (1 << (CodeCompletionContext::CCC_Statement - 1)) | (1 << (CodeCompletionContext::CCC_Expression - 1)) - | (1 << (CodeCompletionContext::CCC_ObjCMessageReceiver - 1)); + | (1 << (CodeCompletionContext::CCC_ObjCMessageReceiver - 1)) + | (1 << (CodeCompletionContext::CCC_Name - 1)) + | (1 << (CodeCompletionContext::CCC_PotentiallyQualifiedName - 1)); + CachedResult.Priority = Results[I].Priority; CachedResult.Kind = Results[I].CursorKind; CachedResult.TypeClass = STC_Void; @@ -1532,6 +1536,8 @@ void CalculateHiddenNames(const CodeCompletionContext &Context, case CodeCompletionContext::CCC_MemberAccess: case CodeCompletionContext::CCC_Namespace: case CodeCompletionContext::CCC_Type: + case CodeCompletionContext::CCC_Name: + case CodeCompletionContext::CCC_PotentiallyQualifiedName: break; case CodeCompletionContext::CCC_EnumTag: |

