18#include "llvm/ADT/StringRef.h"
19#include "gmock/gmock.h"
20#include "gtest/gtest.h"
26using testing::ElementsAre;
27using testing::IsEmpty;
45 EXPECT_THAT(
match(*Idx, Req), IsEmpty());
49 C.Index.External.Location =
"test";
51 EXPECT_THAT(
match(*Idx, Req), ElementsAre(
"1"));
54TEST(ProjectAware, CreatedOnce) {
55 unsigned InvocationCount = 0;
63 EXPECT_EQ(InvocationCount, 0U);
70 EXPECT_EQ(InvocationCount, 0U);
74 C.Index.External.Location =
"test";
78 EXPECT_EQ(InvocationCount, 1U);
81 EXPECT_EQ(InvocationCount, 1U);
Runs tasks on separate (detached) threads and wait for all tasks to finish.
static std::unique_ptr< SymbolIndex > build(SymbolSlab Symbols, RefSlab Refs, RelationSlab Relations)
Builds an index from slabs. The index takes ownership of the data.
An efficient structure of storing large set of symbol references in memory.
SymbolSlab::Builder is a mutable container that can 'freeze' to SymbolSlab.
void insert(const Symbol &S)
Adds a symbol, overwriting any existing one with the same ID.
WithContextValue extends Context::current() with a single value.
FIXME: Skip testing on windows temporarily due to the different escaping code mode.
std::vector< std::string > match(const SymbolIndex &I, const FuzzyFindRequest &Req, bool *Incomplete)
TEST(BackgroundQueueTest, Priority)
Symbol symbol(llvm::StringRef QName)
std::unique_ptr< SymbolIndex > createProjectAwareIndex(IndexFactory Gen, bool Sync)
Returns an index that answers queries using external indices.
std::unique_ptr< SymbolIndex > createIndex()
std::function< std::unique_ptr< SymbolIndex >( const Config::ExternalIndexSpec &, AsyncTaskRunner *)> IndexFactory
A functor to create an index for an external index specification.
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
Describes an external index configuration.
Settings that express user/project preferences and control clangd behavior.
static clangd::Key< Config > Key
Context key which can be used to set the current Config.
std::string Query
A query string for the fuzzy find.
bool AnyScope
If set to true, allow symbols from any scope.