diff options
Diffstat (limited to 'clang-tools-extra/clangd/ClangdServer.h')
-rw-r--r-- | clang-tools-extra/clangd/ClangdServer.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/clang-tools-extra/clangd/ClangdServer.h b/clang-tools-extra/clangd/ClangdServer.h index 0be16026036..cc9f713c85f 100644 --- a/clang-tools-extra/clangd/ClangdServer.h +++ b/clang-tools-extra/clangd/ClangdServer.h @@ -21,8 +21,10 @@ #include "index/Background.h" #include "index/FileIndex.h" #include "index/Index.h" +#include "refactor/Tweak.h" #include "clang/Tooling/CompilationDatabase.h" #include "clang/Tooling/Core/Replacement.h" +#include "llvm/ADT/FunctionExtras.h" #include "llvm/ADT/IntrusiveRefCntPtr.h" #include "llvm/ADT/Optional.h" #include "llvm/ADT/StringRef.h" @@ -211,6 +213,18 @@ public: void rename(PathRef File, Position Pos, llvm::StringRef NewName, Callback<std::vector<tooling::Replacement>> CB); + struct TweakRef { + TweakID ID; /// ID to pass for applyTweak. + std::string Title; /// A single-line message to show in the UI. + }; + /// Enumerate the code tweaks available to the user at a specified point. + void enumerateTweaks(PathRef File, Range Sel, + Callback<std::vector<TweakRef>> CB); + + /// Apply the code tweak with a specified \p ID. + void applyTweak(PathRef File, Range Sel, TweakID ID, + Callback<tooling::Replacements> CB); + /// Only for testing purposes. /// Waits until all requests to worker thread are finished and dumps AST for /// \p File. \p File must be in the list of added documents. |