Call compile for code completion and reset diagnostics after completion.

This commit is contained in:
CristinaCristescu 2016-07-22 15:46:38 +02:00 committed by sftnight
parent ee3e035ceb
commit 5e2df99165
2 changed files with 5 additions and 6 deletions

View File

@ -793,6 +793,8 @@ namespace cling {
&& "Completion point wrongly set!");
assert(PP.isCodeCompletionReached()
&& "Code completion set but not reached!");
m_Consumer->getTransaction()->setIssuedDiags(Transaction::kErrors);
return kSuccess;
}

View File

@ -665,7 +665,7 @@ namespace cling {
// This triggers the FileEntry to be created and the completion
// point to be set in clang.
m_IncrParser->Parse(wrappedInput, CO);
m_IncrParser->Compile(wrappedInput, CO);
return kSuccess;
}
@ -744,10 +744,7 @@ namespace cling {
// Restore the original diagnostics client for parent interpreter.
parentDiagnostics.setClient(clientDiagConsumer,
ownerDiagConsumer.release() != nullptr);
// FIX-ME : Change it in the Incremental Parser
// It does not work by call unload in IncrementalParser, might be to early.
childInterpreter.unload(1);
parentDiagnostics.Reset(/*soft=*/true);
return kSuccess;
}
@ -1470,7 +1467,7 @@ namespace cling {
std::string includeFile = std::string("#include \"") + inFile.str() + "\"";
IncrementalParser::ParseResultTransaction PRT
= fwdGen.m_IncrParser->Parse(includeFile, CO);
= fwdGen.m_IncrParser->Compile(includeFile, CO);
cling::Transaction* T = PRT.getPointer();
// If this was already #included we will get a T == 0.