diff --git a/cpp/ycm/ClangCompleter/TranslationUnit.cpp b/cpp/ycm/ClangCompleter/TranslationUnit.cpp index 9638c2df..fd01fcc6 100644 --- a/cpp/ycm/ClangCompleter/TranslationUnit.cpp +++ b/cpp/ycm/ClangCompleter/TranslationUnit.cpp @@ -57,7 +57,7 @@ TranslationUnit::TranslationUnit( std::vector< CXUnsavedFile > cxunsaved_files = ToCXUnsavedFiles( unsaved_files ); const CXUnsavedFile *unsaved = cxunsaved_files.size() > 0 - ? &cxunsaved_files [0] : NULL; + ? &cxunsaved_files[ 0 ] : NULL; clang_translation_unit_ = clang_parseTranslationUnit( clang_index, @@ -146,7 +146,8 @@ std::vector< CompletionData > TranslationUnit::CandidatesForLocation( std::vector< CXUnsavedFile > cxunsaved_files = ToCXUnsavedFiles( unsaved_files ); const CXUnsavedFile *unsaved = cxunsaved_files.size() > 0 - ? &cxunsaved_files [0] : NULL; + ? &cxunsaved_files[ 0 ] : NULL; + // codeCompleteAt reparses the TU if the underlying source file has changed on // disk since the last time the TU was updated and there are no unsaved files. // If there are unsaved files, then codeCompleteAt will parse the in-memory @@ -242,7 +243,8 @@ void TranslationUnit::Reparse( std::vector< CXUnsavedFile > &unsaved_files, if ( !clang_translation_unit_ ) return; CXUnsavedFile *unsaved = unsaved_files.size() > 0 - ? &unsaved_files [0] : NULL; + ? &unsaved_files[ 0 ] : NULL; + failure = clang_reparseTranslationUnit( clang_translation_unit_, unsaved_files.size(), unsaved,