@@ -704,38 +704,6 @@ void ClangdServer::codeAction(const CodeActionInputs &Params,
704
704
Transient);
705
705
}
706
706
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
-
739
707
void ClangdServer::applyTweak (PathRef File, Range Sel, StringRef TweakID,
740
708
Callback<Tweak::Effect> CB) {
741
709
// Tracks number of times a tweak has been attempted.
0 commit comments