9 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_INDEX_INDEX_H 10 #define LLVM_CLANG_TOOLS_EXTRA_CLANGD_INDEX_INDEX_H 16 #include "llvm/ADT/DenseSet.h" 17 #include "llvm/ADT/Optional.h" 18 #include "llvm/ADT/StringExtras.h" 19 #include "llvm/Support/JSON.h" 52 return std::tie(Query, Scopes, Limit, RestrictForCodeCompletion,
53 ProximityPaths, PreferredTypes) ==
64 llvm::DenseSet<SymbolID>
IDs;
68 llvm::DenseSet<SymbolID>
IDs;
111 llvm::function_ref<
void(
const Ref &)>
Callback)
const = 0;
116 virtual void relations(
122 virtual size_t estimateMemoryUsage()
const = 0;
131 void reset(std::unique_ptr<SymbolIndex>);
136 llvm::function_ref<
void(
const Symbol &)>)
const override;
138 llvm::function_ref<
void(
const Symbol &)>)
const override;
140 llvm::function_ref<
void(
const Ref &)>)
const override;
145 size_t estimateMemoryUsage()
const override;
148 std::shared_ptr<SymbolIndex> snapshot()
const;
149 mutable std::mutex Mutex;
150 std::shared_ptr<SymbolIndex>
Index;
156 #endif // LLVM_CLANG_TOOLS_EXTRA_CLANGD_INDEX_INDEX_H llvm::DenseSet< SymbolID > IDs
llvm::json::Value toJSON(const FuzzyFindRequest &Request)
bool AnyScope
If set to true, allow symbols from any scope.
SwapIndex(std::unique_ptr< SymbolIndex > Index=nullptr)
bool RestrictForCodeCompletion
If set to true, only symbols for completion support will be considered.
llvm::Optional< uint32_t > Limit
If set, limit the number of relations returned from the index.
Interface for symbol indexes that can be used for searching or matching symbols among a set of symbol...
llvm::DenseSet< SymbolID > IDs
Represents a symbol occurrence in the source file.
llvm::unique_function< void(llvm::Expected< T >)> Callback
A Callback<T> is a void function that accepts Expected<T>.
bool operator==(const FuzzyFindRequest &Req) const
index::SymbolRole Predicate
std::vector< std::string > PreferredTypes
Preferred types of symbols. These are raw representation of OpaqueType.
std::vector< std::string > Scopes
If this is non-empty, symbols must be in at least one of the scopes (e.g.
std::vector< std::string > lookup(const SymbolIndex &I, llvm::ArrayRef< SymbolID > IDs)
std::string Query
A query string for the fuzzy find.
RefKind
Describes the kind of a cross-reference.
bool operator!=(const FuzzyFindRequest &Req) const
llvm::DenseSet< SymbolID > Subjects
bool fromJSON(const llvm::json::Value &Parameters, FuzzyFindRequest &Request)
The class presents a C++ symbol, e.g.
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
std::vector< std::string > ProximityPaths
Contextually relevant files (e.g.
llvm::Optional< uint32_t > Limit
If set, limit the number of refers returned from the index.
llvm::Optional< uint32_t > Limit
The number of top candidates to return.
const SymbolIndex * Index