From 6da3db4af3bf89029111e8f92c61484fe1c1ec51 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Tue, 25 May 2010 05:58:43 +0000 Subject: Improve code completion in failure cases in two ways: 1) Suppress diagnostics as soon as we form the code-completion token, so we don't get any error/warning spew from the early end-of-file. 2) If we consume a code-completion token when we weren't expecting one, go into a code-completion recovery path that produces the best results it can based on the context that the parser is in. llvm-svn: 104585 --- clang/lib/Sema/CodeCompleteConsumer.cpp | 20 -------------------- 1 file changed, 20 deletions(-) (limited to 'clang/lib/Sema/CodeCompleteConsumer.cpp') diff --git a/clang/lib/Sema/CodeCompleteConsumer.cpp b/clang/lib/Sema/CodeCompleteConsumer.cpp index 0ef9a15faaf..52562f6b447 100644 --- a/clang/lib/Sema/CodeCompleteConsumer.cpp +++ b/clang/lib/Sema/CodeCompleteConsumer.cpp @@ -459,11 +459,6 @@ PrintingCodeCompleteConsumer::ProcessCodeCompleteResults(Sema &SemaRef, } } } - - // Once we've printed the code-completion results, suppress remaining - // diagnostics. - // FIXME: Move this somewhere else! - SemaRef.PP.getDiagnostics().setSuppressAllDiagnostics(); } void @@ -478,11 +473,6 @@ PrintingCodeCompleteConsumer::ProcessOverloadCandidates(Sema &SemaRef, delete CCS; } } - - // Once we've printed the code-completion results, suppress remaining - // diagnostics. - // FIXME: Move this somewhere else! - SemaRef.PP.getDiagnostics().setSuppressAllDiagnostics(); } void @@ -599,11 +589,6 @@ CIndexCodeCompleteConsumer::ProcessCodeCompleteResults(Sema &SemaRef, CCS->Serialize(OS); delete CCS; } - - // Once we've printed the code-completion results, suppress remaining - // diagnostics. - // FIXME: Move this somewhere else! - SemaRef.PP.getDiagnostics().setSuppressAllDiagnostics(); } void @@ -619,9 +604,4 @@ CIndexCodeCompleteConsumer::ProcessOverloadCandidates(Sema &SemaRef, CCS->Serialize(OS); delete CCS; } - - // Once we've printed the code-completion results, suppress remaining - // diagnostics. - // FIXME: Move this somewhere else! - SemaRef.PP.getDiagnostics().setSuppressAllDiagnostics(); } -- cgit v1.2.3