diff --git a/src/clang_tu.cc b/src/clang_tu.cc index 0a42a6ee..278e2e75 100644 --- a/src/clang_tu.cc +++ b/src/clang_tu.cc @@ -97,9 +97,10 @@ std::unique_ptr ClangTranslationUnit::Create( /*CacheCodeCompletionResults=*/true, g_config->index.comments, /*AllowPCHWithCompilerErrors=*/true, #if LLVM_VERSION_MAJOR >= 7 - SkipFunctionBodiesScope::None, + diagnostic ? SkipFunctionBodiesScope::None + : SkipFunctionBodiesScope::PreambleAndMainFile, #else - false, + !diagnostic, #endif /*SingleFileParse=*/false, /*UserFilesAreVolatile=*/true, false, diff --git a/src/fuzzy_match.cc b/src/fuzzy_match.cc index ad0762be..08f446b4 100644 --- a/src/fuzzy_match.cc +++ b/src/fuzzy_match.cc @@ -31,7 +31,7 @@ void CalculateRoles(std::string_view s, int roles[], int *class_set) { if (cur == Other) return None; // U(U)L is Head while U(U)U is Tail - return pre == Other || (cur == Upper && (pre == Lower || suc != Upper)) + return pre == Other || (cur == Upper && (pre == Lower || suc == Lower)) ? Head : Tail; };