|
clang-tools 24.0.0git
|
Ensure we have enough bits to represent all SymbolTag values. More...
#include <Symbol.h>
Classes | |
| struct | IncludeHeaderWithReferences |
Public Types | |
| enum | IncludeDirective : uint8_t { Invalid = 0 , Include = 1 , Import = 2 } |
| enum | SymbolFlag : uint8_t { None = 0 , IndexedForCodeCompletion = 1 << 0 , Deprecated = 1 << 1 , ImplementationDetail = 1 << 2 , VisibleOutsideFile = 1 << 3 , HasDocComment = 1 << 4 } |
Public Attributes | |
| SymbolID | ID |
| The ID of the symbol. | |
| index::SymbolInfo | SymInfo = index::SymbolInfo() |
| The symbol information, like symbol kind. | |
| SymbolOrigin | Origin = SymbolOrigin::Unknown |
| Where this symbol came from. Usually an index provides a constant value. | |
| llvm::StringRef | Name |
| The unqualified name of the symbol, e.g. "bar" (for ns::bar). | |
| llvm::StringRef | Scope |
| The containing namespace. e.g. "" (global), "ns::" (top-level namespace). | |
| SymbolLocation | Definition |
| The location of the symbol's definition, if one was found. | |
| SymbolLocation | CanonicalDeclaration |
| The location of the preferred declaration of the symbol. | |
| unsigned | References = 0 |
| The number of translation units that reference this symbol from their main file. | |
| SymbolTags | Tags = 0 |
| Symbol tags for LSP protocol (Deprecated, Static, Virtual, Abstract, Final, ReadOnly, Public, Protected, Private, Declaration, Definition). | |
| llvm::StringRef | Signature |
| A brief description of the symbol that can be appended in the completion candidate list. | |
| llvm::StringRef | TemplateSpecializationArgs |
| Argument list in human-readable format, will be displayed to help disambiguate between different specializations of a template. | |
| llvm::StringRef | CompletionSnippetSuffix |
| What to insert when completing this symbol, after the symbol name. | |
| llvm::StringRef | Documentation |
| Documentation including comment for the symbol declaration. | |
| llvm::StringRef | ReturnType |
| Type when this symbol is used in an expression. | |
| llvm::StringRef | Type |
| Raw representation of the OpaqueType of the symbol, used for scoring purposes. | |
| llvm::SmallVector< IncludeHeaderWithReferences, 1 > | IncludeHeaders |
| One Symbol can potentially be included via different headers. | |
| SymbolFlag | Flags = SymbolFlag::None |
Ensure we have enough bits to represent all SymbolTag values.
The class presents a C++ symbol, e.g. class, function.
WARNING: Symbols do not own much of their underlying data - typically strings are owned by a SymbolSlab. They should be treated as non-owning references. Copies are shallow.
When adding new unowned data fields to Symbol, remember to update:
A fully documented symbol can be split as: size_type std::map<k, t>::count(const K& key) const | Return | Scope |Name| Signature | We split up these components to allow display flexibility later.
| enum clang::clangd::Symbol::IncludeDirective : uint8_t |
| enum clang::clangd::Symbol::SymbolFlag : uint8_t |
| Enumerator | |
|---|---|
| None | |
| IndexedForCodeCompletion | Whether or not this symbol is meant to be used for the code completion. See also isIndexedForCodeCompletion(). Note that we don't store completion information (signature, snippet, type, includes) if the symbol is not indexed for code completion. |
| Deprecated | Indicates if the symbol is deprecated. |
| ImplementationDetail | Symbol is an implementation detail. |
| VisibleOutsideFile | Symbol is visible to other files (not e.g. a static helper function). |
| HasDocComment | Symbol has an attached documentation comment. |
| SymbolLocation clang::clangd::Symbol::CanonicalDeclaration |
The location of the preferred declaration of the symbol.
This just covers the symbol name. This may be the same as Definition.
A C++ symbol may have multiple declarations, and we pick one to prefer.
Definition at line 71 of file Symbol.h.
Referenced by clang::clangd::remote::Marshaller::fromProtobuf(), clang::clangd::getCorrespondingHeaderOrSource(), clang::clangd::SymbolCollector::handleMacroOccurrence(), clang::clangd::SymbolCollector::handleMacros(), clang::clangd::locateSymbolTextually(), llvm::yaml::MappingTraits< Symbol >::mapping(), clang::clangd::SymbolRelevanceSignals::merge(), clang::clangd::mergeSymbol(), clang::clangd::symbolToLocation(), clang::clangd::remote::Marshaller::toProtobuf(), and clang::clangd::visitStrings().
| llvm::StringRef clang::clangd::Symbol::CompletionSnippetSuffix |
What to insert when completing this symbol, after the symbol name.
This is in LSP snippet syntax (e.g. "({$0})" for a no-args function). (When snippets are disabled, the symbol name alone is used). Only set when the symbol is indexed for completion.
Definition at line 91 of file Symbol.h.
Referenced by clang::clangd::remote::Marshaller::fromProtobuf(), clang::clangd::SymbolCollector::handleMacroOccurrence(), llvm::yaml::MappingTraits< Symbol >::mapping(), clang::clangd::mergeSymbol(), clang::clangd::remote::Marshaller::toProtobuf(), and clang::clangd::visitStrings().
| SymbolLocation clang::clangd::Symbol::Definition |
The location of the symbol's definition, if one was found.
This just covers the symbol name (e.g. without class/function body).
Definition at line 62 of file Symbol.h.
Referenced by clang::clangd::remote::Marshaller::fromProtobuf(), clang::clangd::getCorrespondingHeaderOrSource(), clang::clangd::locateSymbolTextually(), llvm::yaml::MappingTraits< Symbol >::mapping(), clang::clangd::mergeSymbol(), clang::clangd::symbolToLocation(), clang::clangd::remote::Marshaller::toProtobuf(), and clang::clangd::visitStrings().
| llvm::StringRef clang::clangd::Symbol::Documentation |
Documentation including comment for the symbol declaration.
Definition at line 93 of file Symbol.h.
Referenced by clang::clangd::remote::Marshaller::fromProtobuf(), llvm::yaml::MappingTraits< Symbol >::mapping(), clang::clangd::mergeSymbol(), clang::clangd::remote::Marshaller::toProtobuf(), and clang::clangd::visitStrings().
| SymbolFlag clang::clangd::Symbol::Flags = SymbolFlag::None |
Definition at line 165 of file Symbol.h.
Referenced by clang::clangd::remote::Marshaller::fromProtobuf(), clang::clangd::MemIndex::fuzzyFind(), clang::clangd::SymbolCollector::handleMacroOccurrence(), clang::clangd::SymbolCollector::handleMacros(), llvm::yaml::MappingTraits< Symbol >::mapping(), clang::clangd::SymbolQualitySignals::merge(), clang::clangd::SymbolRelevanceSignals::merge(), clang::clangd::mergeSymbol(), clang::clangd::objcSym(), clang::clangd::sym(), clang::clangd::symbolToTypeHierarchyItem(), and clang::clangd::remote::Marshaller::toProtobuf().
| SymbolID clang::clangd::Symbol::ID |
The ID of the symbol.
Definition at line 51 of file Symbol.h.
Referenced by clang::clangd::SymbolSlab::Builder::build(), clang::clangd::SymbolSlab::find(), clang::clangd::remote::Marshaller::fromProtobuf(), clang::clangd::MergedIndex::fuzzyFind(), clang::clangd::SymbolCollector::handleMacroOccurrence(), clang::clangd::SymbolCollector::handleMacros(), clang::clangd::incomingCalls(), clang::clangd::SymbolSlab::Builder::insert(), clang::clangd::locateSymbolTextually(), clang::clangd::MergedIndex::lookup(), llvm::yaml::MappingTraits< Symbol >::mapping(), clang::clangd::SymbolRelevanceSignals::merge(), clang::clangd::mergeSymbol(), clang::clangd::objcSym(), clang::clangd::superTypes(), clang::clangd::sym(), clang::clangd::symbol(), clang::clangd::symbolToCallHierarchyItem(), clang::clangd::symbolToTypeHierarchyItem(), and clang::clangd::remote::Marshaller::toProtobuf().
| llvm::SmallVector<IncludeHeaderWithReferences, 1> clang::clangd::Symbol::IncludeHeaders |
One Symbol can potentially be included via different headers.
Definition at line 147 of file Symbol.h.
Referenced by clang::clangd::SymbolCollector::finish(), clang::clangd::remote::Marshaller::fromProtobuf(), clang::clangd::getRankedIncludes(), llvm::yaml::MappingTraits< Symbol >::mapping(), clang::clangd::mergeSymbol(), clang::clangd::remote::Marshaller::toProtobuf(), and clang::clangd::visitStrings().
| llvm::StringRef clang::clangd::Symbol::Name |
The unqualified name of the symbol, e.g. "bar" (for ns::bar).
Definition at line 57 of file Symbol.h.
Referenced by clang::clangd::remote::Marshaller::fromProtobuf(), clang::clangd::dex::Dex::fuzzyFind(), clang::clangd::MemIndex::fuzzyFind(), clang::clangd::getQualifiedName(), clang::clangd::getStdHeader(), clang::clangd::getWorkspaceSymbols(), clang::clangd::SymbolCollector::handleMacroOccurrence(), clang::clangd::SymbolCollector::handleMacros(), clang::clangd::locateSymbolTextually(), llvm::yaml::MappingTraits< Symbol >::mapping(), llvm::yaml::MappingTraits< SymbolAndSignals >::mapping(), clang::clangd::SymbolQualitySignals::merge(), clang::clangd::objcSym(), clang::clangd::operator<<(), clang::clangd::sym(), clang::clangd::symbol(), clang::clangd::symbolToHierarchyItem(), clang::clangd::remote::Marshaller::toProtobuf(), and clang::clangd::visitStrings().
| SymbolOrigin clang::clangd::Symbol::Origin = SymbolOrigin::Unknown |
Where this symbol came from. Usually an index provides a constant value.
Definition at line 55 of file Symbol.h.
Referenced by clang::clangd::remote::Marshaller::fromProtobuf(), clang::clangd::SymbolCollector::handleMacroOccurrence(), clang::clangd::SymbolCollector::handleMacros(), clang::clangd::mergeSymbol(), clang::clangd::objcSym(), and clang::clangd::sym().
| unsigned clang::clangd::Symbol::References = 0 |
The number of translation units that reference this symbol from their main file.
This number is only meaningful if aggregated in an index.
Definition at line 74 of file Symbol.h.
Referenced by clang::clangd::remote::Marshaller::fromProtobuf(), llvm::yaml::MappingTraits< Symbol >::mapping(), clang::clangd::SymbolQualitySignals::merge(), clang::clangd::mergeSymbol(), clang::clangd::quality(), and clang::clangd::remote::Marshaller::toProtobuf().
| llvm::StringRef clang::clangd::Symbol::ReturnType |
Type when this symbol is used in an expression.
(Short display form). e.g. return type of a function, or type of a variable. Only set when the symbol is indexed for completion.
Definition at line 97 of file Symbol.h.
Referenced by clang::clangd::remote::Marshaller::fromProtobuf(), llvm::yaml::MappingTraits< Symbol >::mapping(), clang::clangd::mergeSymbol(), clang::clangd::remote::Marshaller::toProtobuf(), and clang::clangd::visitStrings().
| llvm::StringRef clang::clangd::Symbol::Scope |
The containing namespace. e.g. "" (global), "ns::" (top-level namespace).
Definition at line 59 of file Symbol.h.
Referenced by clang::clangd::remote::Marshaller::fromProtobuf(), clang::clangd::MemIndex::fuzzyFind(), clang::clangd::getQualifiedName(), clang::clangd::getStdHeader(), clang::clangd::getWorkspaceSymbols(), clang::clangd::locateSymbolTextually(), llvm::yaml::MappingTraits< Symbol >::mapping(), clang::clangd::SymbolRelevanceSignals::merge(), clang::clangd::objcSym(), clang::clangd::operator<<(), clang::clangd::sym(), clang::clangd::symbol(), clang::clangd::symbolToHierarchyItem(), clang::clangd::remote::Marshaller::toProtobuf(), and clang::clangd::visitStrings().
| llvm::StringRef clang::clangd::Symbol::Signature |
A brief description of the symbol that can be appended in the completion candidate list.
For example, "(X x, Y y) const" is a function signature. Only set when the symbol is indexed for completion.
Definition at line 82 of file Symbol.h.
Referenced by clang::clangd::remote::Marshaller::fromProtobuf(), clang::clangd::getStdHeader(), clang::clangd::SymbolCollector::handleMacroOccurrence(), llvm::yaml::MappingTraits< Symbol >::mapping(), clang::clangd::mergeSymbol(), clang::clangd::sym(), clang::clangd::remote::Marshaller::toProtobuf(), and clang::clangd::visitStrings().
| index::SymbolInfo clang::clangd::Symbol::SymInfo = index::SymbolInfo() |
The symbol information, like symbol kind.
Definition at line 53 of file Symbol.h.
Referenced by clang::clangd::SymbolCollector::finish(), clang::clangd::remote::Marshaller::fromProtobuf(), clang::clangd::getWorkspaceSymbols(), clang::clangd::SymbolCollector::handleMacroOccurrence(), clang::clangd::SymbolCollector::handleMacros(), clang::clangd::locateSymbolTextually(), llvm::yaml::MappingTraits< Symbol >::mapping(), clang::clangd::SymbolQualitySignals::merge(), clang::clangd::SymbolRelevanceSignals::merge(), clang::clangd::mergeSymbol(), clang::clangd::objcSym(), clang::clangd::sym(), clang::clangd::symbolToHierarchyItem(), and clang::clangd::remote::Marshaller::toProtobuf().
| SymbolTags clang::clangd::Symbol::Tags = 0 |
Symbol tags for LSP protocol (Deprecated, Static, Virtual, Abstract, Final, ReadOnly, Public, Protected, Private, Declaration, Definition).
This is a bitmask where each bit represents a SymbolTag.
Definition at line 78 of file Symbol.h.
Referenced by clang::clangd::getSymbolTags(), llvm::yaml::MappingTraits< Symbol >::mapping(), and clang::clangd::mergeSymbol().
| llvm::StringRef clang::clangd::Symbol::TemplateSpecializationArgs |
Argument list in human-readable format, will be displayed to help disambiguate between different specializations of a template.
Empty for non-specializations. Example: "<int, bool, 3>"
Definition at line 86 of file Symbol.h.
Referenced by clang::clangd::remote::Marshaller::fromProtobuf(), clang::clangd::getQualifiedName(), clang::clangd::getWorkspaceSymbols(), clang::clangd::locateSymbolTextually(), llvm::yaml::MappingTraits< Symbol >::mapping(), clang::clangd::remote::Marshaller::toProtobuf(), and clang::clangd::visitStrings().
| llvm::StringRef clang::clangd::Symbol::Type |
Raw representation of the OpaqueType of the symbol, used for scoring purposes.
Only set when the symbol is indexed for completion.
Definition at line 102 of file Symbol.h.
Referenced by clang::clangd::remote::Marshaller::fromProtobuf(), llvm::yaml::MappingTraits< Symbol >::mapping(), llvm::yaml::MappingTraits< SymbolAndSignals >::mapping(), clang::clangd::mergeSymbol(), clang::clangd::remote::Marshaller::toProtobuf(), and clang::clangd::visitStrings().