diff --git a/src/clang_utils.cc b/src/clang_utils.cc index 228fcf5d..c92c6993 100644 --- a/src/clang_utils.cc +++ b/src/clang_utils.cc @@ -26,8 +26,8 @@ optional BuildAndDisposeDiagnostic(CXDiagnostic diagnostic, // Get diagnostic location. CXFile file; unsigned start_line, start_column; - clang_getSpellingLocation(clang_getDiagnosticLocation(diagnostic), - &file, &start_line, &start_column, nullptr); + clang_getSpellingLocation(clang_getDiagnosticLocation(diagnostic), &file, + &start_line, &start_column, nullptr); if (file && path != FileName(file)) { clang_disposeDiagnostic(diagnostic); @@ -35,7 +35,7 @@ optional BuildAndDisposeDiagnostic(CXDiagnostic diagnostic, } unsigned end_line = start_line, end_column = start_column, - num_ranges = clang_getDiagnosticNumRanges(diagnostic); + num_ranges = clang_getDiagnosticNumRanges(diagnostic); for (unsigned i = 0; i < num_ranges; i++) { CXFile file0, file1; unsigned line0, column0, line1, column1; diff --git a/src/indexer.cc b/src/indexer.cc index 410398d1..47a64c1f 100644 --- a/src/indexer.cc +++ b/src/indexer.cc @@ -1396,8 +1396,8 @@ void OnIndexReference(CXClientData client_data, const CXIdxEntityRefInfo* ref) { // But there `decl` is of type CXIdxDeclInfo and has more information, // thus not easy to reuse the code. var->def.short_name = referenced.get_spelling(); - std::string type_name = - ToString(clang_getTypeSpelling(clang_getCursorType(referenced.cx_cursor))); + std::string type_name = ToString( + clang_getTypeSpelling(clang_getCursorType(referenced.cx_cursor))); var->def.detailed_name = type_name + " " + var->def.short_name; var->def.is_local = false; var->def.definition_spelling = ResolveSpelling(referenced.cx_cursor); @@ -1716,12 +1716,14 @@ void ClangSanityCheck() { void* reserved) -> CXIdxClientFile { return nullptr; }; - callback.ppIncludedFile = []( - CXClientData client_data, - const CXIdxIncludedFileInfo* file) -> CXIdxClientFile { return nullptr; }; - callback.importedASTFile = []( - CXClientData client_data, - const CXIdxImportedASTFileInfo*) -> CXIdxClientASTFile { + callback.ppIncludedFile = + [](CXClientData client_data, + const CXIdxIncludedFileInfo* file) -> CXIdxClientFile { + return nullptr; + }; + callback.importedASTFile = + [](CXClientData client_data, + const CXIdxImportedASTFileInfo*) -> CXIdxClientASTFile { return nullptr; }; callback.startedTranslationUnit = [](CXClientData client_data, diff --git a/src/messages/text_document_definition.cc b/src/messages/text_document_definition.cc index 6dd2ae47..f4f617b3 100644 --- a/src/messages/text_document_definition.cc +++ b/src/messages/text_document_definition.cc @@ -2,8 +2,7 @@ #include "query_utils.h" namespace { -void PushBack(std::vector* result, - optional location) { +void PushBack(std::vector* result, optional location) { if (location) result->push_back(*location); } diff --git a/src/query.cc b/src/query.cc index c7ccfbe6..e55b84c2 100644 --- a/src/query.cc +++ b/src/query.cc @@ -617,8 +617,8 @@ IndexUpdate::IndexUpdate(const IdMap& previous_id_map, #undef PROCESS_UPDATE_DIFF } +// This function runs on an indexer thread. void IndexUpdate::Merge(const IndexUpdate& update) { - // This function runs on an indexer thread. #define INDEX_UPDATE_APPEND(name) AddRange(&name, update.name); #define INDEX_UPDATE_MERGE(name) AddMergeableRange(&name, update.name);