[clangd] Populate #include insertions as additional edits in completion items.
authorEric Liu <ioeric@google.com>
Tue, 15 May 2018 15:29:32 +0000 (15:29 +0000)
committerEric Liu <ioeric@google.com>
Tue, 15 May 2018 15:29:32 +0000 (15:29 +0000)
commit63f419a5c676360440aa4e8cb94e9a6d7a4c6133
treec60896c865638d428eead9cb9b9ce8c0834d1837
parent2c1905386c0c4e73dc4e729a76f1095acdff2d2f
[clangd] Populate #include insertions as additional edits in completion items.

Summary:
o Remove IncludeInsertion LSP command.
o Populate include insertion edits synchromously in completion items.
o Share the code completion compiler instance and precompiled preamble to get existing inclusions in main file.
o Include insertion logic lives only in CodeComplete now.
o Use tooling::HeaderIncludes for inserting new includes.
o Refactored tests.

Reviewers: sammccall

Reviewed By: sammccall

Subscribers: klimek, ilya-biryukov, MaskRay, jkorous, cfe-commits

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

llvm-svn: 332363
clang-tools-extra/clangd/ClangdServer.cpp
clang-tools-extra/clangd/CodeComplete.cpp
clang-tools-extra/clangd/CodeComplete.h
clang-tools-extra/clangd/Headers.cpp
clang-tools-extra/clangd/Headers.h
clang-tools-extra/clangd/Protocol.h
clang-tools-extra/unittests/clangd/CodeCompleteTests.cpp
clang-tools-extra/unittests/clangd/HeadersTests.cpp