From 6737599c110f85dc27f87d36833016a3ddc2818e Mon Sep 17 00:00:00 2001 From: Jacob Dufault Date: Mon, 8 May 2017 22:15:35 -0700 Subject: [PATCH] Add CXTranslationUnit_CreatePreambleOnFirstParse for code completion on non-Windows machines. --- src/code_completion.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/code_completion.cc b/src/code_completion.cc index 4ddffc63..f13b99f1 100644 --- a/src/code_completion.cc +++ b/src/code_completion.cc @@ -23,7 +23,12 @@ unsigned Flags() { CXTranslationUnit_CacheCompletionResults | CXTranslationUnit_PrecompiledPreamble | CXTranslationUnit_IncludeBriefCommentsInCodeCompletion | - //CXTranslationUnit_CreatePreambleOnFirstParse | +#if !defined(_WIN32) + // For whatever reason, CreatePreambleOnFirstParse causes clang to become + // very crashy on windows. + // TODO: do more investigation, submit fixes to clang. + CXTranslationUnit_CreatePreambleOnFirstParse | +#endif CXTranslationUnit_DetailedPreprocessingRecord; }