From dd66277c36af442460c60dc993b41b831ee28973 Mon Sep 17 00:00:00 2001 From: Eric Liu Date: Mon, 28 Jan 2019 14:01:55 +0000 Subject: [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 --- clang-tools-extra/clangd/SourceCode.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'clang-tools-extra/clangd/SourceCode.h') 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 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 -- cgit v1.2.3