diff --git a/clang-tools-extra/clangd/ClangdServer.cpp b/clang-tools-extra/clangd/ClangdServer.cpp index dce6bfc04ce6d..13d788162817f 100644 --- a/clang-tools-extra/clangd/ClangdServer.cpp +++ b/clang-tools-extra/clangd/ClangdServer.cpp @@ -704,38 +704,6 @@ void ClangdServer::codeAction(const CodeActionInputs &Params, Transient); } -void ClangdServer::enumerateTweaks( - PathRef File, Range Sel, llvm::unique_function Filter, - Callback> CB) { - auto Action = [Sel, CB = std::move(CB), Filter = std::move(Filter), - FeatureModules(this->FeatureModules)]( - Expected InpAST) mutable { - if (!InpAST) - return CB(InpAST.takeError()); - auto Selections = tweakSelection(Sel, *InpAST, /*FS=*/nullptr); - if (!Selections) - return CB(Selections.takeError()); - std::vector Res; - // Don't allow a tweak to fire more than once across ambiguous selections. - llvm::DenseSet PreparedTweaks; - auto DeduplicatingFilter = [&](const Tweak &T) { - return Filter(T) && !PreparedTweaks.count(T.id()); - }; - for (const auto &Sel : *Selections) { - for (auto &T : prepareTweaks(*Sel, DeduplicatingFilter, FeatureModules)) { - Res.push_back({T->id(), T->title(), T->kind()}); - PreparedTweaks.insert(T->id()); - TweakAvailable.record(1, T->id()); - } - } - - CB(std::move(Res)); - }; - - WorkScheduler->runWithAST("EnumerateTweaks", File, std::move(Action), - Transient); -} - void ClangdServer::applyTweak(PathRef File, Range Sel, StringRef TweakID, Callback CB) { // Tracks number of times a tweak has been attempted. diff --git a/clang-tools-extra/clangd/ClangdServer.h b/clang-tools-extra/clangd/ClangdServer.h index 2bc8f02ff38a4..a416602251428 100644 --- a/clang-tools-extra/clangd/ClangdServer.h +++ b/clang-tools-extra/clangd/ClangdServer.h @@ -386,13 +386,6 @@ class ClangdServer { void codeAction(const CodeActionInputs &Inputs, Callback CB); - /// Enumerate the code tweaks available to the user at a specified point. - /// Tweaks where Filter returns false will not be checked or included. - /// Deprecated, use codeAction instead. - void enumerateTweaks(PathRef File, Range Sel, - llvm::unique_function Filter, - Callback> CB); - /// Apply the code tweak with a specified \p ID. void applyTweak(PathRef File, Range Sel, StringRef ID, Callback CB);