clang-tools
10.0.0
|
A set of edits generated for a single file. More...
#include <SourceCode.h>
Public Member Functions | |
Edit (llvm::StringRef Code, tooling::Replacements Reps) | |
llvm::Expected< std::string > | apply () const |
Returns the file contents after changes are applied. More... | |
std::vector< TextEdit > | asTextEdits () const |
Represents Replacements as TextEdits that are available for use in LSP. More... | |
bool | canApplyTo (llvm::StringRef Code) const |
Checks whether the Replacements are applicable to given Code. More... | |
Public Attributes | |
tooling::Replacements | Replacements |
std::string | InitialCode |
A set of edits generated for a single file.
Can verify whether it is safe to apply these edits to a code block.
Definition at line 204 of file SourceCode.h.
|
inline |
Definition at line 208 of file SourceCode.h.
llvm::Expected< std::string > clang::clangd::Edit::apply | ( | ) | const |
Returns the file contents after changes are applied.
Definition at line 1013 of file SourceCode.cpp.
std::vector< TextEdit > clang::clangd::Edit::asTextEdits | ( | ) | const |
Represents Replacements as TextEdits that are available for use in LSP.
Definition at line 1017 of file SourceCode.cpp.
References clang::clangd::replacementsToEdits().
bool clang::clangd::Edit::canApplyTo | ( | llvm::StringRef | Code | ) | const |
Checks whether the Replacements are applicable to given Code.
Definition at line 1021 of file SourceCode.cpp.
std::string clang::clangd::Edit::InitialCode |
Definition at line 206 of file SourceCode.h.
tooling::Replacements clang::clangd::Edit::Replacements |
Definition at line 205 of file SourceCode.h.