summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clangd/SourceCode.h
diff options
context:
space:
mode:
authorEric Liu <ioeric@google.com>2019-01-28 14:01:55 +0000
committerEric Liu <ioeric@google.com>2019-01-28 14:01:55 +0000
commitdd66277c36af442460c60dc993b41b831ee28973 (patch)
treea553ff33620d144f505a9b64f6bd0233727c6327 /clang-tools-extra/clangd/SourceCode.h
parent6d5348cca557fe16675bdcafe504103c530f2aab (diff)
downloadbcm5719-llvm-dd66277c36af442460c60dc993b41b831ee28973.tar.gz
bcm5719-llvm-dd66277c36af442460c60dc993b41b831ee28973.zip
[clangd] Suggest adding missing includes for incomplete type diagnostics.
Summary: This enables clangd to intercept compiler diagnostics and attach fixes (e.g. by querying index). This patch adds missing includes for incomplete types e.g. member access into class with only forward declaration. This would allow adding missing includes for user-typed symbol names that are missing declarations (e.g. typos) in the future. Reviewers: sammccall Reviewed By: sammccall Subscribers: mgorny, ilya-biryukov, javed.absar, MaskRay, jkorous, mgrang, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D56903 llvm-svn: 352361
Diffstat (limited to 'clang-tools-extra/clangd/SourceCode.h')
-rw-r--r--clang-tools-extra/clangd/SourceCode.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang-tools-extra/clangd/SourceCode.h b/clang-tools-extra/clangd/SourceCode.h
index 7c8499d83b7..2bbfd338cd1 100644
--- a/clang-tools-extra/clangd/SourceCode.h
+++ b/clang-tools-extra/clangd/SourceCode.h
@@ -16,7 +16,9 @@
#include "clang/Basic/Diagnostic.h"
#include "clang/Basic/SourceLocation.h"
#include "clang/Basic/SourceManager.h"
+#include "clang/Format/Format.h"
#include "clang/Tooling/Core/Replacement.h"
+#include "llvm/ADT/StringRef.h"
#include "llvm/Support/SHA1.h"
namespace clang {
@@ -91,6 +93,11 @@ llvm::Optional<std::string> getCanonicalPath(const FileEntry *F,
const SourceManager &SourceMgr);
bool isRangeConsecutive(const Range &Left, const Range &Right);
+
+format::FormatStyle getFormatStyleForFile(llvm::StringRef File,
+ llvm::StringRef Content,
+ llvm::vfs::FileSystem *FS);
+
} // namespace clangd
} // namespace clang
#endif
OpenPOWER on IntegriCloud