[clangd] Fixes for #include insertion.
authorEric Liu <ioeric@google.com>
Mon, 19 Feb 2018 18:48:44 +0000 (18:48 +0000)
committerEric Liu <ioeric@google.com>
Mon, 19 Feb 2018 18:48:44 +0000 (18:48 +0000)
commit709bde886d9b6f27e17d427a81938ba8f885466f
tree1c86207b15b1145068ce3e2e239107a28beaad91
parent7fac6e92a70b8860e41d228ea03dd24fcf5f83bb
[clangd] Fixes for #include insertion.

Summary:
o Avoid inserting a header include into the header itself.
o Avoid inserting non-header files (by not indexing symbols in main
files at all).
o Canonicalize include paths for symbols in dynamic index.

Reviewers: sammccall, ilya-biryukov

Reviewed By: ilya-biryukov

Subscribers: klimek, jkorous-apple, cfe-commits

Differential Revision: https://reviews.llvm.org/D43462

llvm-svn: 325523
clang-tools-extra/clangd/ClangdServer.cpp
clang-tools-extra/clangd/Headers.cpp
clang-tools-extra/clangd/Headers.h
clang-tools-extra/clangd/index/CanonicalIncludes.cpp
clang-tools-extra/clangd/index/CanonicalIncludes.h
clang-tools-extra/clangd/index/FileIndex.cpp
clang-tools-extra/unittests/clangd/CodeCompleteTests.cpp
clang-tools-extra/unittests/clangd/FileIndexTests.cpp
clang-tools-extra/unittests/clangd/HeadersTests.cpp