23#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_INDEX_DEX_TRIGRAM_H
24#define LLVM_CLANG_TOOLS_EXTRA_CLANGD_INDEX_DEX_TRIGRAM_H
27#include "llvm/ADT/bit.h"
39 std::array<char, 4> Data;
40 uint32_t id()
const {
return llvm::bit_cast<uint32_t>(Data); }
45 Trigram(
char A,
char B) : Data{A, B, 0, 2} {}
46 Trigram(
char A,
char B,
char C) : Data{A, B, C, 3} {}
47 std::string
str()
const {
return std::string(Data.data(), Data[3]); }
48 friend struct ::llvm::DenseMapInfo<Trigram>;
70 std::vector<Trigram> &Out);
88template <>
struct DenseMapInfo<
clang::clangd::dex::Trigram> {
94 X *= uint32_t{0x85ebca6b};
96 X *= uint32_t{0xc2b2ae35};
static clang::FrontendPluginRegistry::Add< clang::tidy::ClangTidyPluginAction > X("clang-tidy", "clang-tidy")
friend bool operator==(Trigram L, Trigram R)
friend bool operator<(Trigram L, Trigram R)
Trigram(char A, char B, char C)
Token objects represent a characteristic of a symbol, which can be used to perform efficient search.
void generateIdentifierTrigrams(llvm::StringRef Identifier, std::vector< Trigram > &Result)
Produces list of unique fuzzy-search trigrams from unqualified symbol.
std::vector< Token > generateQueryTrigrams(llvm::StringRef Query)
Returns list of unique fuzzy-search trigrams given a query.
FIXME: Skip testing on windows temporarily due to the different escaping code mode.
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
Some operations such as code completion produce a set of candidates.
static unsigned getHashValue(Trigram V)
clang::clangd::dex::Trigram Trigram
static bool isEqual(const Trigram &LHS, const Trigram &RHS)