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"));
55TEST(ProjectAware, CreatedOnce) {
56 unsigned InvocationCount = 0;
64 EXPECT_EQ(InvocationCount, 0U);
71 EXPECT_EQ(InvocationCount, 0U);
75 C.Index.External.Location =
"test";
79 EXPECT_EQ(InvocationCount, 1U);
82 EXPECT_EQ(InvocationCount, 1U);
CodeCompletionBuilder Builder
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.
WithContextValue extends Context::current() with a single value.
std::function< std::unique_ptr< SymbolIndex >(const Config::ExternalIndexSpec &, AsyncTaskRunner *)> IndexFactory
A functor to create an index for an external index specification.
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()
===– 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.