Added functionality to suggest FixIts for conversion of '->' to '.' and vice versa.
Summary: Added functionality to suggest FixIts for conversion of '->' to '.' and vice versa.
Reviewers: ilya-biryukov
Reviewed By: ilya-biryukov
Subscribers: yvvan, ioeric, jkorous, arphaman, cfe-commits, kadircet
Differential Revision: https://reviews.llvm.org/D50193
llvm-svn: 339224
diff --git a/clang-tools-extra/clangd/SourceCode.cpp b/clang-tools-extra/clangd/SourceCode.cpp
index d302518..88ec2c9 100644
--- a/clang-tools-extra/clangd/SourceCode.cpp
+++ b/clang-tools-extra/clangd/SourceCode.cpp
@@ -199,5 +199,14 @@
return FilePath.str().str();
}
+TextEdit toTextEdit(const FixItHint &FixIt, const SourceManager &M,
+ const LangOptions &L) {
+ TextEdit Result;
+ Result.range =
+ halfOpenToRange(M, Lexer::makeFileCharRange(FixIt.RemoveRange, M, L));
+ Result.newText = FixIt.CodeToInsert;
+ return Result;
+}
+
} // namespace clangd
} // namespace clang