clang-tools 20.0.0git
Public Attributes | List of all members
clang::clangd::SymbolCollector::Options Struct Reference

#include <SymbolCollector.h>

Public Attributes

std::string FallbackDir
 When symbol paths cannot be resolved to absolute paths (e.g.
 
bool CollectIncludePath = false
 
const include_cleaner::PragmaIncludes * PragmaIncludes = nullptr
 If set, this is used to map symbol #include path to a potentially different #include path specified by IWYU pragmas.
 
bool CountReferences = false
 
RefKind RefFilter = RefKind::Unknown
 The symbol ref kinds that will be collected.
 
bool RefsInHeaders = false
 If set to true, SymbolCollector will collect all refs (from main file and included headers); otherwise, only refs from main file will be collected.
 
SymbolOrigin Origin = SymbolOrigin::Unknown
 
bool CollectMacro = false
 Collect macros.
 
bool CollectMainFileSymbols = true
 Collect symbols local to main-files, such as static functions, symbols inside an anonymous namespace, function-local classes and its member functions.
 
bool CollectMainFileRefs = false
 Collect references to main-file symbols.
 
bool CollectReserved = false
 Collect symbols with reserved names, like __Vector_base.
 
bool StoreAllDocumentation = false
 If set to true, SymbolCollector will collect doc for all symbols.
 
std::function< bool(const SourceManager &, FileID)> FileFilter = nullptr
 If this is set, only collect symbols/references from a file if FileFilter(SM, FID) is true.
 

Detailed Description

Definition at line 60 of file SymbolCollector.h.

Member Data Documentation

◆ CollectIncludePath

bool clang::clangd::SymbolCollector::Options::CollectIncludePath = false

Definition at line 66 of file SymbolCollector.h.

◆ CollectMacro

bool clang::clangd::SymbolCollector::Options::CollectMacro = false

Collect macros.

Note that SymbolCollector must be run with preprocessor in order to collect macros. For example, indexTopLevelDecls will not index any macro even if this is true.

Definition at line 89 of file SymbolCollector.h.

Referenced by clang::clangd::SymbolCollector::finish(), clang::clangd::SymbolCollector::handleMacroOccurrence(), and clang::clangd::indexStandardLibrary().

◆ CollectMainFileRefs

bool clang::clangd::SymbolCollector::Options::CollectMainFileRefs = false

Collect references to main-file symbols.

Definition at line 95 of file SymbolCollector.h.

Referenced by clang::clangd::SymbolCollector::handleDeclOccurrence(), and clang::clangd::indexStandardLibrary().

◆ CollectMainFileSymbols

bool clang::clangd::SymbolCollector::Options::CollectMainFileSymbols = true

Collect symbols local to main-files, such as static functions, symbols inside an anonymous namespace, function-local classes and its member functions.

Definition at line 93 of file SymbolCollector.h.

Referenced by clang::clangd::SymbolCollector::handleMacroOccurrence(), and clang::clangd::indexStandardLibrary().

◆ CollectReserved

bool clang::clangd::SymbolCollector::Options::CollectReserved = false

Collect symbols with reserved names, like __Vector_base.

This does not currently affect macros (many like _WIN32 are important!) This only affects system headers.

Definition at line 99 of file SymbolCollector.h.

◆ CountReferences

bool clang::clangd::SymbolCollector::Options::CountReferences = false

◆ FallbackDir

std::string clang::clangd::SymbolCollector::Options::FallbackDir

When symbol paths cannot be resolved to absolute paths (e.g.

files in VFS that does not have absolute path), combine the fallback directory with symbols' paths to get absolute paths. This must be an absolute path.

Definition at line 65 of file SymbolCollector.h.

◆ FileFilter

std::function<bool(const SourceManager &, FileID)> clang::clangd::SymbolCollector::Options::FileFilter = nullptr

If this is set, only collect symbols/references from a file if FileFilter(SM, FID) is true.

If not set, all files are indexed.

Definition at line 106 of file SymbolCollector.h.

Referenced by clang::clangd::SymbolCollector::shouldIndexFile().

◆ Origin

SymbolOrigin clang::clangd::SymbolCollector::Options::Origin = SymbolOrigin::Unknown

◆ PragmaIncludes

const include_cleaner::PragmaIncludes* clang::clangd::SymbolCollector::Options::PragmaIncludes = nullptr

If set, this is used to map symbol #include path to a potentially different #include path specified by IWYU pragmas.

Definition at line 69 of file SymbolCollector.h.

◆ RefFilter

RefKind clang::clangd::SymbolCollector::Options::RefFilter = RefKind::Unknown

The symbol ref kinds that will be collected.

If not set, SymbolCollector will not collect refs. Note that references of namespace decls are not collected, as they contribute large part of the index, and they are less useful compared with other decls.

Definition at line 77 of file SymbolCollector.h.

Referenced by clang::clangd::SymbolCollector::handleDeclOccurrence(), and clang::clangd::SymbolCollector::handleMacroOccurrence().

◆ RefsInHeaders

bool clang::clangd::SymbolCollector::Options::RefsInHeaders = false

If set to true, SymbolCollector will collect all refs (from main file and included headers); otherwise, only refs from main file will be collected.

This flag is only meaningful when RefFilter is set.

Definition at line 82 of file SymbolCollector.h.

Referenced by clang::clangd::SymbolCollector::handleDeclOccurrence(), and clang::clangd::SymbolCollector::handleMacroOccurrence().

◆ StoreAllDocumentation

bool clang::clangd::SymbolCollector::Options::StoreAllDocumentation = false

If set to true, SymbolCollector will collect doc for all symbols.

Note that documents of symbols being indexed for completion will always be collected regardless of this option.

Definition at line 103 of file SymbolCollector.h.

Referenced by clang::clangd::indexStandardLibrary().


The documentation for this struct was generated from the following file: