Go to the documentation of this file.
18 #include "llvm/ADT/StringRef.h"
19 #include "gmock/gmock.h"
20 #include "gtest/gtest.h"
26 using testing::ElementsAre;
27 using testing::IsEmpty;
45 EXPECT_THAT(
match(*Idx, Req), IsEmpty());
49 C.Index.External.Location =
"test";
51 EXPECT_THAT(
match(*Idx, Req), ElementsAre(
"1"));
55 TEST(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);
TEST(BackgroundQueueTest, Priority)
std::unique_ptr< SymbolIndex > createProjectAwareIndex(IndexFactory Gen, bool Sync)
Returns an index that answers queries using external indices.
Settings that express user/project preferences and control clangd behavior.
An efficient structure of storing large set of symbol references in memory.
std::string Query
A query string for the fuzzy find.
std::vector< std::string > match(const SymbolIndex &I, const FuzzyFindRequest &Req, bool *Incomplete)
WithContextValue extends Context::current() with a single value.
CodeCompletionBuilder Builder
static std::unique_ptr< SymbolIndex > build(SymbolSlab Symbols, RefSlab Refs, RelationSlab Relations)
Builds an index from slabs. The index takes ownership of the data.
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
Describes an external index configuration.
Runs tasks on separate (detached) threads and wait for all tasks to finish.
std::unique_ptr< SymbolIndex > createIndex()
bool AnyScope
If set to true, allow symbols from any scope.
static clangd::Key< Config > Key
Context key which can be used to set the current Config.
Symbol symbol(llvm::StringRef QName)
SymbolSlab::Builder is a mutable container that can 'freeze' to SymbolSlab.
std::function< std::unique_ptr< SymbolIndex >(const Config::ExternalIndexSpec &, AsyncTaskRunner *)> IndexFactory
A functor to create an index for an external index specification.