diff options
Diffstat (limited to 'clang-tools-extra/clangd/CodeComplete.cpp')
-rw-r--r-- | clang-tools-extra/clangd/CodeComplete.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/clang-tools-extra/clangd/CodeComplete.cpp b/clang-tools-extra/clangd/CodeComplete.cpp index b5304dbffe7..045320fc543 100644 --- a/clang-tools-extra/clangd/CodeComplete.cpp +++ b/clang-tools-extra/clangd/CodeComplete.cpp @@ -1053,7 +1053,9 @@ bool semaCodeComplete(std::unique_ptr<CodeCompleteConsumer> Consumer, ParseInput.FS = VFS; ParseInput.Contents = Input.Contents; ParseInput.Opts = ParseOptions(); - auto CI = buildCompilerInvocation(ParseInput); + + IgnoreDiagnostics IgnoreDiags; + auto CI = buildCompilerInvocation(ParseInput, IgnoreDiags); if (!CI) { elog("Couldn't create CompilerInvocation"); return false; @@ -1084,12 +1086,11 @@ bool semaCodeComplete(std::unique_ptr<CodeCompleteConsumer> Consumer, bool CompletingInPreamble = PreambleRegion.Size > Input.Offset; // NOTE: we must call BeginSourceFile after prepareCompilerInstance. Otherwise // the remapped buffers do not get freed. - IgnoreDiagnostics DummyDiagsConsumer; auto Clang = prepareCompilerInstance( std::move(CI), (Input.Preamble && !CompletingInPreamble) ? &Input.Preamble->Preamble : nullptr, - std::move(ContentsBuffer), std::move(VFS), DummyDiagsConsumer); + std::move(ContentsBuffer), std::move(VFS), IgnoreDiags); Clang->getPreprocessorOpts().SingleFileParseMode = CompletingInPreamble; Clang->setCodeCompletionConsumer(Consumer.release()); |