--- a/third_party/ycmd/cpp/ycm/ClangCompleter/TranslationUnit.cpp
+++ b/third_party/ycmd/cpp/ycm/ClangCompleter/TranslationUnit.cpp
@@ -66,6 +66,7 @@ TranslationUnit::TranslationUnit(
                               pointer_flags.size(),
                               const_cast<CXUnsavedFile *>( unsaved ),
                               cxunsaved_files.size(),
+                              CXTranslationUnit_DetailedPreprocessingRecord |
                               clang_defaultEditingTranslationUnitOptions() );

   if ( !clang_translation_unit_ )
@@ -249,7 +250,7 @@ void TranslationUnit::Reparse( std::vector< CXUnsavedFile > &unsaved_files,
     failure = clang_reparseTranslationUnit( clang_translation_unit_,
                                             unsaved_files.size(),
                                             unsaved,
-                                            parse_options );
+                                            CXTranslationUnit_DetailedPreprocessingRecord | parse_options );
   }

   if ( failure ) {
