[PATCH] D43510: [clangd] don't insert new includes if either original header or canonical header is already included.

Eric Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 20 06:33:53 PST 2018


ioeric created this revision.
ioeric added a reviewer: sammccall.
Herald added subscribers: cfe-commits, jkorous-apple, ilya-biryukov, klimek.

Changes:
o Store both the original header and the canonical header in LSP command.
o Also check that both original and canonical headers are not already included
by comparing both resolved header path and written literal includes.

This addresses the use case where private IWYU pragma is defined in a private
header while it would still be preferrable to include the private header, in the
internal implementation file. If we have seen that the priviate header is already
included, we don't try to insert the canonical include.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D43510

Files:
  clangd/ClangdLSPServer.cpp
  clangd/ClangdServer.cpp
  clangd/ClangdServer.h
  clangd/CodeComplete.cpp
  clangd/Headers.cpp
  clangd/Headers.h
  clangd/Protocol.cpp
  clangd/Protocol.h
  test/clangd/insert-include.test
  unittests/clangd/ClangdTests.cpp
  unittests/clangd/HeadersTests.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D43510.135045.patch
Type: text/x-patch
Size: 20422 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180220/24a2795d/attachment-0001.bin>


More information about the cfe-commits mailing list