Skip to content

Commit 26f9e49

Browse files
committed
[clangd] Delete deprecated enumerateTweaks endpoint
1 parent be5b666 commit 26f9e49

File tree

2 files changed

+0
-39
lines changed

2 files changed

+0
-39
lines changed

clang-tools-extra/clangd/ClangdServer.cpp

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -704,38 +704,6 @@ void ClangdServer::codeAction(const CodeActionInputs &Params,
704704
Transient);
705705
}
706706

707-
void ClangdServer::enumerateTweaks(
708-
PathRef File, Range Sel, llvm::unique_function<bool(const Tweak &)> Filter,
709-
Callback<std::vector<TweakRef>> CB) {
710-
auto Action = [Sel, CB = std::move(CB), Filter = std::move(Filter),
711-
FeatureModules(this->FeatureModules)](
712-
Expected<InputsAndAST> InpAST) mutable {
713-
if (!InpAST)
714-
return CB(InpAST.takeError());
715-
auto Selections = tweakSelection(Sel, *InpAST, /*FS=*/nullptr);
716-
if (!Selections)
717-
return CB(Selections.takeError());
718-
std::vector<TweakRef> Res;
719-
// Don't allow a tweak to fire more than once across ambiguous selections.
720-
llvm::DenseSet<llvm::StringRef> PreparedTweaks;
721-
auto DeduplicatingFilter = [&](const Tweak &T) {
722-
return Filter(T) && !PreparedTweaks.count(T.id());
723-
};
724-
for (const auto &Sel : *Selections) {
725-
for (auto &T : prepareTweaks(*Sel, DeduplicatingFilter, FeatureModules)) {
726-
Res.push_back({T->id(), T->title(), T->kind()});
727-
PreparedTweaks.insert(T->id());
728-
TweakAvailable.record(1, T->id());
729-
}
730-
}
731-
732-
CB(std::move(Res));
733-
};
734-
735-
WorkScheduler->runWithAST("EnumerateTweaks", File, std::move(Action),
736-
Transient);
737-
}
738-
739707
void ClangdServer::applyTweak(PathRef File, Range Sel, StringRef TweakID,
740708
Callback<Tweak::Effect> CB) {
741709
// Tracks number of times a tweak has been attempted.

clang-tools-extra/clangd/ClangdServer.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -386,13 +386,6 @@ class ClangdServer {
386386
void codeAction(const CodeActionInputs &Inputs,
387387
Callback<CodeActionResult> CB);
388388

389-
/// Enumerate the code tweaks available to the user at a specified point.
390-
/// Tweaks where Filter returns false will not be checked or included.
391-
/// Deprecated, use codeAction instead.
392-
void enumerateTweaks(PathRef File, Range Sel,
393-
llvm::unique_function<bool(const Tweak &)> Filter,
394-
Callback<std::vector<TweakRef>> CB);
395-
396389
/// Apply the code tweak with a specified \p ID.
397390
void applyTweak(PathRef File, Range Sel, StringRef ID,
398391
Callback<Tweak::Effect> CB);

0 commit comments

Comments
 (0)