Index: clang-tools-extra/trunk/clangd/index/Background.h =================================================================== --- clang-tools-extra/trunk/clangd/index/Background.h +++ clang-tools-extra/trunk/clangd/index/Background.h @@ -18,7 +18,9 @@ #include "llvm/Support/SHA1.h" #include #include +#include #include +#include namespace clang { namespace clangd { @@ -31,7 +33,8 @@ public: // FIXME: resource-dir injection should be hoisted somewhere common. BackgroundIndex(Context BackgroundContext, StringRef ResourceDir, - const FileSystemProvider &); + const FileSystemProvider &, + ArrayRef URISchemes = {}); ~BackgroundIndex(); // Blocks while the current task finishes. // Enqueue a translation unit for indexing. @@ -54,6 +57,7 @@ std::string ResourceDir; const FileSystemProvider &FSProvider; Context BackgroundContext; + std::vector URISchemes; // index state llvm::Error index(tooling::CompileCommand); Index: clang-tools-extra/trunk/clangd/index/Background.cpp =================================================================== --- clang-tools-extra/trunk/clangd/index/Background.cpp +++ clang-tools-extra/trunk/clangd/index/Background.cpp @@ -24,10 +24,11 @@ BackgroundIndex::BackgroundIndex(Context BackgroundContext, StringRef ResourceDir, - const FileSystemProvider &FSProvider) + const FileSystemProvider &FSProvider, + ArrayRef URISchemes) : SwapIndex(make_unique()), ResourceDir(ResourceDir), FSProvider(FSProvider), BackgroundContext(std::move(BackgroundContext)), - Thread([this] { run(); }) {} + URISchemes(URISchemes), Thread([this] { run(); }) {} BackgroundIndex::~BackgroundIndex() { stop(); @@ -185,7 +186,7 @@ // FIXME: this should rebuild once-in-a-while, not after every file. // At that point we should use Dex, too. vlog("Rebuilding automatic index"); - reset(IndexedSymbols.buildIndex(IndexType::Light)); + reset(IndexedSymbols.buildIndex(IndexType::Light, URISchemes)); return Error::success(); }