[clangd] Mark macros from preamble for code completion
authorKadir Cetinkaya <kadircet@google.com>
Wed, 10 Nov 2021 11:10:33 +0000 (12:10 +0100)
committerKadir Cetinkaya <kadircet@google.com>
Fri, 12 Nov 2021 13:01:14 +0000 (14:01 +0100)
commit7d668ae38d2d54ebd5eca5f66a8cf353c3526dc3
treee269b80caa9cfe92ac39d6b5f449432c77783fa4
parent1d7fdbbc183aee2f1168425ae21e961164495466
[clangd] Mark macros from preamble for code completion

If the main file is a header, mark the marcos defined in its preamble
section as code-completion ready.

Fixes https://github.com/clangd/clangd/issues/921.

Differential Revision: https://reviews.llvm.org/D113555
clang-tools-extra/clangd/index/SymbolCollector.cpp
clang-tools-extra/clangd/unittests/FileIndexTests.cpp