diff --git a/clang-tools-extra/clangd/ClangdServer.h b/clang-tools-extra/clangd/ClangdServer.h --- a/clang-tools-extra/clangd/ClangdServer.h +++ b/clang-tools-extra/clangd/ClangdServer.h @@ -121,7 +121,7 @@ ClangTidyOptionsBuilder GetClangTidyOptions; /// If true, turn on the `-frecovery-ast` clang flag. - bool BuildRecoveryAST = false; + bool BuildRecoveryAST = true; /// If true, turn on the `-frecovery-ast-type` clang flag. bool PreserveRecoveryASTType = false; @@ -354,7 +354,7 @@ bool SuggestMissingIncludes = false; // If true, preserve expressions in AST for broken code. - bool BuildRecoveryAST = false; + bool BuildRecoveryAST = true; // If true, preserve the type for recovery AST. bool PreserveRecoveryASTType = false; diff --git a/clang-tools-extra/clangd/tool/ClangdMain.cpp b/clang-tools-extra/clangd/tool/ClangdMain.cpp --- a/clang-tools-extra/clangd/tool/ClangdMain.cpp +++ b/clang-tools-extra/clangd/tool/ClangdMain.cpp @@ -281,11 +281,10 @@ opt RecoveryAST{ "recovery-ast", cat(Features), - desc("Preserve expressions in AST for broken code (C++ only). Note that " - "this feature is experimental and may lead to crashes"), - init(false), - Hidden, + desc("Preserve expressions in AST for broken code (C++ only)."), + init(ClangdServer::Options().BuildRecoveryAST), }; + opt RecoveryASTType{ "recovery-ast-type", cat(Features),