[clangd] Fix bugs in main-file include patching for stale preambles
authorKadir Cetinkaya <kadircet@google.com>
Thu, 2 Feb 2023 13:15:56 +0000 (14:15 +0100)
committerKadir Cetinkaya <kadircet@google.com>
Mon, 13 Feb 2023 08:49:13 +0000 (09:49 +0100)
commitfae01d175a29270ec01211d3988c7ae57ddabfd3
treef9953aef94f7825901838e6977fb62796a8060b0
parentf79a5fb9df42cebb97dfb86e25b4697ad72cc606
[clangd] Fix bugs in main-file include patching for stale preambles

- Make sure main file includes are present even when they're not patched
  (because they didn't change or we're explicitly not patching them).
- Populate extra fields for includes, which can be used by include-cleaner.

Differential Revision: https://reviews.llvm.org/D143197
clang-tools-extra/clangd/Preamble.cpp
clang-tools-extra/clangd/unittests/PreambleTests.cpp