kdevplatform/language/duchain
Classes | |
class | DUChainItemFilter |
struct | ItemUnderCursor |
Functions | |
KDEVPLATFORMLANGUAGE_EXPORT QVector< KDevelop::Problem::Ptr > | allProblemsForContext (const ReferencedTopDUContext &top) |
KDEVPLATFORMLANGUAGE_EXPORT DUContext * | argumentContext (Declaration *decl) |
KDEVPLATFORMLANGUAGE_EXPORT QList< IndexedDeclaration > | collectAllVersions (Declaration *decl) |
KDEVPLATFORMLANGUAGE_EXPORT void | collectItems (DUContext *context, DUChainItemFilter &filter) |
KDEVPLATFORMLANGUAGE_EXPORT KTextEditor::CodeCompletionModel::CompletionProperties | completionProperties (const Declaration *dec) |
KDEVPLATFORMLANGUAGE_EXPORT TopDUContext * | contentContextFromProxyContext (TopDUContext *top) |
KDEVPLATFORMLANGUAGE_EXPORT uint | contextCountUses (DUContext *context, Declaration *declaration) |
KDEVPLATFORMLANGUAGE_EXPORT bool | contextHasUse (DUContext *context, Declaration *declaration) |
KDEVPLATFORMLANGUAGE_EXPORT Declaration * | declarationForDefinition (Declaration *definition, TopDUContext *topContext=nullptr) |
KDEVPLATFORMLANGUAGE_EXPORT Declaration * | declarationInLine (const KTextEditor::Cursor &cursor, KDevelop::DUContext *ctx) |
KDEVPLATFORMLANGUAGE_EXPORT DUContext * | functionContext (Declaration *decl) |
KDEVPLATFORMLANGUAGE_EXPORT QIcon | iconForDeclaration (const Declaration *dec) |
KDEVPLATFORMLANGUAGE_EXPORT QIcon | iconForProperties (KTextEditor::CodeCompletionModel::CompletionProperties p) |
KDEVPLATFORMLANGUAGE_EXPORT QList< Declaration * > | inheriters (const Declaration *decl, uint &maxAllowedSteps, bool collectVersions=true) |
KDEVPLATFORMLANGUAGE_EXPORT ItemUnderCursor | itemUnderCursor (const QUrl &url, const KTextEditor::Cursor &cursor) |
KDEVPLATFORMLANGUAGE_EXPORT Declaration * | overridden (const Declaration *decl) |
KDEVPLATFORMLANGUAGE_EXPORT QList< Declaration * > | overriders (const Declaration *currentClass, const Declaration *overriddenDeclaration, uint &maxAllowedSteps) |
KDEVPLATFORMLANGUAGE_EXPORT KDevelop::TopDUContext * | standardContextForUrl (const QUrl &url, bool preferProxyContext=false) |
Detailed Description
A namespace which contains convenience utilities for navigating definition-use chains.
Function Documentation
◆ allProblemsForContext()
QVector< KDevelop::Problem::Ptr > KDevelop::DUChainUtils::allProblemsForContext | ( | const ReferencedTopDUContext & | top | ) |
Definition at line 626 of file duchainutils.cpp.
◆ argumentContext()
KDevelop::DUContext * KDevelop::DUChainUtils::argumentContext | ( | KDevelop::Declaration * | decl | ) |
Definition at line 439 of file duchainutils.cpp.
◆ collectAllVersions()
QList< IndexedDeclaration > KDevelop::DUChainUtils::collectAllVersions | ( | Declaration * | decl | ) |
Uses the persistent symbol table to find all occurrences of this declaration, based on its identifier.
The result should be filtered to make sure that the declaration is actually useful to you.
Definition at line 454 of file duchainutils.cpp.
◆ collectItems()
void KDevelop::DUChainUtils::collectItems | ( | DUContext * | context, |
DUChainItemFilter & | filter | ||
) |
walks a context, all its sub-contexts, and all its declarations in exactly the order they appear in the file.
Re-implement DUChainItemFilter to do something with the items.
Definition at line 393 of file duchainutils.cpp.
◆ completionProperties()
CodeCompletionModel::CompletionProperties KDevelop::DUChainUtils::completionProperties | ( | const Declaration * | dec | ) |
Definition at line 52 of file duchainutils.cpp.
◆ contentContextFromProxyContext()
TopDUContext * KDevelop::DUChainUtils::contentContextFromProxyContext | ( | TopDUContext * | top | ) |
Returns the content-context associated to the given proxy-contex.
Returns the same context if it is not a proxy-context. Returns zero if no content-context could be acquired.
Definition at line 247 of file duchainutils.cpp.
◆ contextCountUses()
uint KDevelop::DUChainUtils::contextCountUses | ( | DUContext * | context, |
Declaration * | declaration | ||
) |
Returns the total count of uses of the given declaration under the given context.
Definition at line 583 of file duchainutils.cpp.
◆ contextHasUse()
bool KDevelop::DUChainUtils::contextHasUse | ( | DUContext * | context, |
Declaration * | declaration | ||
) |
Returns whether the given context or any of its child-contexts contain a use of the given declaration. This is relatively expensive.
Definition at line 561 of file duchainutils.cpp.
◆ declarationForDefinition()
Declaration * KDevelop::DUChainUtils::declarationForDefinition | ( | Declaration * | definition, |
TopDUContext * | topContext = nullptr |
||
) |
If the given declaration is a definition, and has a real declaration attached, returns that declarations.
Else returns the given argument.
Definition at line 348 of file duchainutils.cpp.
◆ declarationInLine()
Declaration * KDevelop::DUChainUtils::declarationInLine | ( | const KTextEditor::Cursor & | cursor, |
KDevelop::DUContext * | ctx | ||
) |
Returns the first declaration in the given line.
Searches the given context and all sub-contexts. Must only be called from the foreground or with the foreground lock held.
Definition at line 365 of file duchainutils.cpp.
◆ functionContext()
DUContext * KDevelop::DUChainUtils::functionContext | ( | Declaration * | decl | ) |
If the given declaration is a function-declaration, this follows the context-structure up to the function-context that contains the arguments, and returns it.
Definition at line 610 of file duchainutils.cpp.
◆ iconForDeclaration()
QIcon KDevelop::DUChainUtils::iconForDeclaration | ( | const Declaration * | dec | ) |
Definition at line 242 of file duchainutils.cpp.
◆ iconForProperties()
QIcon KDevelop::DUChainUtils::iconForProperties | ( | KTextEditor::CodeCompletionModel::CompletionProperties | p | ) |
Definition at line 161 of file duchainutils.cpp.
◆ inheriters()
QList< Declaration * > KDevelop::DUChainUtils::inheriters | ( | const Declaration * | decl, |
uint & | maxAllowedSteps, | ||
bool | collectVersions = true |
||
) |
If the given declaration is a class, this gets all classes that inherit this one.
- Parameters
-
collectVersions If this is true, the persistent symbol table is used to first find all registered versions of this class, and then get the inheriters from them all together. This is needed for C++. maxAllowedSteps The maximum of steps allowed. If this is zero in the end, this means the search has been stopped with the max. reached If you really want all inheriters, you should initialize it with a very large value.
Definition at line 519 of file duchainutils.cpp.
◆ itemUnderCursor()
DUChainUtils::ItemUnderCursor KDevelop::DUChainUtils::itemUnderCursor | ( | const QUrl & | url, |
const KTextEditor::Cursor & | cursor | ||
) |
Returns 1.
the Declaration/Definition either declared or used under the cursor, or zero; and 2. the context in which the declaration, definition, or use was found. DUChain must be locked. Must only be called from the foreground or with the foreground lock held.
Definition at line 332 of file duchainutils.cpp.
◆ overridden()
Declaration * KDevelop::DUChainUtils::overridden | ( | const Declaration * | decl | ) |
Returns the declaration that is overridden by the given one, or zero.
Definition at line 587 of file duchainutils.cpp.
◆ overriders()
QList< Declaration * > KDevelop::DUChainUtils::overriders | ( | const Declaration * | currentClass, |
const Declaration * | overriddenDeclaration, | ||
uint & | maxAllowedSteps | ||
) |
Gets all functions that override the function overriddenDeclaration
, starting the search at currentClass
.
- Parameters
-
maxAllowedSteps The maximum of steps allowed. If this is zero in the end, this means the search has been stopped with the max. reached
Definition at line 530 of file duchainutils.cpp.
◆ standardContextForUrl()
TopDUContext * KDevelop::DUChainUtils::standardContextForUrl | ( | const QUrl & | url, |
bool | preferProxyContext = false |
||
) |
Asks the language-plugins for standard-contexts for the given url, and returns one if available.
If there is no language-plugin registered for the given url, it will just try to get any top-context for the file from the du-chain. NOTE: The DUChain needs to be read or write locked when you call this.
- Parameters
-
preferProxyContext Whether the returned context should be a proxy context. When no proxy-context is found, a normal context is returned.
FIXME: this should operate on IndexedString
Definition at line 273 of file duchainutils.cpp.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Thu Mar 4 2021 23:31:18 by doxygen 1.8.16 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.