[clangd] Indexing of standard library
authorSam McCall <sam.mccall@gmail.com>
Sun, 28 Nov 2021 23:09:41 +0000 (00:09 +0100)
committerSam McCall <sam.mccall@gmail.com>
Tue, 17 May 2022 14:50:41 +0000 (16:50 +0200)
commitecaa4d9662c9a6ac013ac40a8ad72a2c75e3fd3b
tree65fde4d95f7057e8327cf90ab2d3155a7e76024b
parent8430b827419534cbd0c6ade12abea1d00a033eba
[clangd] Indexing of standard library

This provides a nice "warm start" with all headers indexed, not just
those included so far.

The standard library is indexed after a preamble is parsed, using that
file's configuration. The result is pushed into the dynamic index.
If we later see a higher language version, we reindex it.

It's configurable as Index.StandardLibrary, off by default for now.

Based on D105177 by @kuhnel

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

Differential Revision: https://reviews.llvm.org/D115232
18 files changed:
clang-tools-extra/clangd/CMakeLists.txt
clang-tools-extra/clangd/ClangdServer.cpp
clang-tools-extra/clangd/ClangdServer.h
clang-tools-extra/clangd/Config.h
clang-tools-extra/clangd/ConfigCompile.cpp
clang-tools-extra/clangd/ConfigFragment.h
clang-tools-extra/clangd/ConfigYAML.cpp
clang-tools-extra/clangd/TUScheduler.cpp
clang-tools-extra/clangd/TUScheduler.h
clang-tools-extra/clangd/index/FileIndex.cpp
clang-tools-extra/clangd/index/FileIndex.h
clang-tools-extra/clangd/index/StdLib.cpp [new file with mode: 0644]
clang-tools-extra/clangd/index/StdLib.h [new file with mode: 0644]
clang-tools-extra/clangd/index/SymbolOrigin.cpp
clang-tools-extra/clangd/index/SymbolOrigin.h
clang-tools-extra/clangd/unittests/CMakeLists.txt
clang-tools-extra/clangd/unittests/StdLibTests.cpp [new file with mode: 0644]
clang-tools-extra/clangd/unittests/TUSchedulerTests.cpp