12 #include "clang/AST/ASTContext.h" 13 #include "clang/AST/Decl.h" 14 #include "clang/Index/IndexDataConsumer.h" 15 #include "clang/Index/IndexSymbol.h" 16 #include "clang/Sema/CodeCompleteConsumer.h" 74 this->PP = std::move(PP);
79 ArrayRef<index::SymbolRelation> Relations,
81 index::IndexDataConsumer::ASTNodeInfo ASTNode)
override;
84 index::SymbolRoleSet Roles,
85 SourceLocation Loc)
override;
93 void addDefinition(
const NamedDecl &,
const Symbol &DeclSymbol);
98 std::shared_ptr<Preprocessor> PP;
99 std::shared_ptr<GlobalCodeCompletionAllocator> CompletionAllocator;
100 std::unique_ptr<CodeCompletionTUInfo> CompletionTUInfo;
103 llvm::DenseSet<const NamedDecl *> ReferencedDecls;
104 llvm::DenseSet<const IdentifierInfo *> ReferencedMacros;
110 llvm::DenseMap<const Decl *, const Decl *> CanonicalDecls;
SourceLocation Loc
'#' location in the include directive
bool handleMacroOccurence(const IdentifierInfo *Name, const MacroInfo *MI, index::SymbolRoleSet Roles, SourceLocation Loc) override
bool CollectMacro
Collect macros.
std::vector< std::string > URISchemes
Specifies URI schemes that can be used to generate URIs for file paths in symbols.
Collect declarations (symbols) from an AST.
void initialize(ASTContext &Ctx) override
Maps a definition location onto an #include file, based on a set of filename rules.
std::string FallbackDir
When symbol paths cannot be resolved to absolute paths (e.g.
bool handleDeclOccurence(const Decl *D, index::SymbolRoleSet Roles, ArrayRef< index::SymbolRelation > Relations, SourceLocation Loc, index::IndexDataConsumer::ASTNodeInfo ASTNode) override
SymbolCollector(Options Opts)
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
void setPreprocessor(std::shared_ptr< Preprocessor > PP) override
static bool shouldCollectSymbol(const NamedDecl &ND, ASTContext &ASTCtx, const Options &Opts)
Returns true is ND should be collected.
tooling::ExecutionContext * Ctx
const CanonicalIncludes * Includes
If set, this is used to map symbol #include path to a potentially different #include path...