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 @@ -131,7 +131,7 @@ bool BuildRecoveryAST = true; /// If true, turn on the `-frecovery-ast-type` clang flag. - bool PreserveRecoveryASTType = false; + bool PreserveRecoveryASTType = true; /// Clangd's workspace root. Relevant for "workspace" operations not bound /// to a particular file. 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 @@ -291,9 +291,8 @@ opt RecoveryASTType{ "recovery-ast-type", cat(Features), - desc("Preserve the type for recovery AST. Note that " - "this feature is experimental and may lead to crashes"), - init(false), + desc("Preserve the type for recovery AST."), + init(ClangdServer::Options().PreserveRecoveryASTType), Hidden, };