diff --git a/clang-tools-extra/clangd/ClangdLSPServer.cpp b/clang-tools-extra/clangd/ClangdLSPServer.cpp --- a/clang-tools-extra/clangd/ClangdLSPServer.cpp +++ b/clang-tools-extra/clangd/ClangdLSPServer.cpp @@ -584,6 +584,7 @@ {"callHierarchyProvider", true}, {"clangdInlayHintsProvider", true}, {"inlayHintProvider", true}, + {"foldingRangeProvider", true}, }; { @@ -613,8 +614,6 @@ CodeAction::INFO_KIND}}} : llvm::json::Value(true); - if (Opts.FoldingRanges) - ServerCaps["foldingRangeProvider"] = true; std::vector Commands; for (llvm::StringRef Command : Handlers.CommandHandlers.keys()) @@ -1618,8 +1617,7 @@ Bind.method("clangd/inlayHints", this, &ClangdLSPServer::onClangdInlayHints); Bind.method("textDocument/inlayHint", this, &ClangdLSPServer::onInlayHint); Bind.method("$/memoryUsage", this, &ClangdLSPServer::onMemoryUsage); - if (Opts.FoldingRanges) - Bind.method("textDocument/foldingRange", this, &ClangdLSPServer::onFoldingRange); + Bind.method("textDocument/foldingRange", this, &ClangdLSPServer::onFoldingRange); Bind.command(ApplyFixCommand, this, &ClangdLSPServer::onCommandApplyEdit); Bind.command(ApplyTweakCommand, this, &ClangdLSPServer::onCommandApplyTweak); 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 @@ -161,9 +161,6 @@ /// fetch system include path. std::vector QueryDriverGlobs; - /// Enable preview of FoldingRanges feature. - bool FoldingRanges = false; - // Whether the client supports folding only complete lines. bool LineFoldingOnly = false; diff --git a/clang-tools-extra/clangd/test/initialize-params.test b/clang-tools-extra/clangd/test/initialize-params.test --- a/clang-tools-extra/clangd/test/initialize-params.test +++ b/clang-tools-extra/clangd/test/initialize-params.test @@ -43,6 +43,7 @@ # CHECK-NEXT: "clangd.applyTweak" # CHECK-NEXT: ] # CHECK-NEXT: }, +# CHECK-NEXT: "foldingRangeProvider": true, # CHECK-NEXT: "hoverProvider": true, # CHECK-NEXT: "implementationProvider": true, # CHECK-NEXT: "inlayHintProvider": true, 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 @@ -308,6 +308,8 @@ RetiredFlag CrossFileRename("cross-file-rename"); RetiredFlag ClangTidyChecks("clang-tidy-checks"); RetiredFlag InlayHints("inlay-hints"); +RetiredFlag FoldingRanges("folding-ranges"); + opt LimitResults{ "limit-results", @@ -333,14 +335,6 @@ CommaSeparated, }; -opt FoldingRanges{ - "folding-ranges", - cat(Features), - desc("Enable preview of FoldingRanges feature"), - init(false), - Hidden, -}; - opt WorkerThreadsCount{ "j", cat(Misc), @@ -903,7 +897,6 @@ Opts.StaticIndex = PAI.get(); } Opts.AsyncThreadsCount = WorkerThreadsCount; - Opts.FoldingRanges = FoldingRanges; Opts.MemoryCleanup = getMemoryCleanupFunction(); Opts.CodeComplete.IncludeIneligibleResults = IncludeIneligibleResults;