[PATCH] D53503: [clangd] Support URISchemes configuration in BackgroundIndex.
Eric Liu via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Oct 22 08:40:05 PDT 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rL344912: [clangd] Support URISchemes configuration in BackgroundIndex. (authored by ioeric, committed by ).
Herald added a subscriber: llvm-commits.
Repository:
rL LLVM
https://reviews.llvm.org/D53503
Files:
clang-tools-extra/trunk/clangd/index/Background.cpp
clang-tools-extra/trunk/clangd/index/Background.h
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 <condition_variable>
#include <deque>
+#include <string>
#include <thread>
+#include <vector>
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<std::string> 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<std::string> 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<std::string> URISchemes)
: SwapIndex(make_unique<MemIndex>()), 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();
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D53503.170429.patch
Type: text/x-patch
Size: 2315 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20181022/f00ed9b8/attachment-0001.bin>
More information about the cfe-commits
mailing list