kdevplatform/language/duchain
usescollector.cpp
Go to the documentation of this file.
58 //Ignore proxy-contexts while collecting. Those build a parallel and much more complicated structure.
162 if (m_collectOverloads && decl->context()->owner() && decl->context()->type() == DUContext::Class) {
251 //the header that contains the declaration. That header may be parsed empty due to header-guards,
285 qCDebug(LANGUAGE) << "Collected contexts for full re-parse, before filtering: " << collected.size() <<
309 //If we used the AllDeclarationsContextsAndUsesRecursive flag here, we would compute way too much. This way we only
363 void UsesCollector::updateReady(const KDevelop::IndexedString& url, KDevelop::ReferencedTopDUContext topContext)
370 if (topContext->parsingEnvironmentFile() && topContext->parsingEnvironmentFile()->isProxyContext()) {
374 if (import.context(nullptr) && import.context(nullptr)->topContext()->parsingEnvironmentFile() &&
385 if (topContext->parsingEnvironmentFile() && topContext->parsingEnvironmentFile()->isProxyContext()) {
413 qCWarning(LANGUAGE) << "WARNING: context" << topContext->url().str() << "does not have the required features!!";
416 ICore::self()->projectController()->prettyFileName(topContext->url().toUrl(), KDevelop::IProjectController::FormatPlain) + QLatin1String(" failed!");
425 const auto prettyFileName = ICore::self()->projectController()->prettyFileName(topContext->url().toUrl(), KDevelop::IProjectController::FormatPlain);
444 if (m_declaration.data() && ((m_processDeclarations && m_declarationTopContexts.contains(indexed)) ||
Allows simple indirect access to top-contexts with on-demand loading.
Definition: indexedtopducontext.h:35
bool isEmpty() const
Customized read locker for the definition-use chain.
Definition: duchainlock.h:114
QList< IndexedDeclaration > declarations()
The declarations that were used as base for the search For classes this contains forward-declarations...
Definition: usescollector.cpp:117
void startCollecting()
This must be called to start the actual collecting!
Definition: usescollector.cpp:145
static DUChainLock * lock()
Retrieve the read write lock for the entire definition-use chain.
Definition: duchain.cpp:1283
QList< QExplicitlySharedDataPointer< ParsingEnvironmentFile > > imports() const
Returns the parsing-environment information of all imports of the coupled TopDUContext.
Definition: parsingenvironment.cpp:189
KDevelop can unload unused top-context at any time.
Definition: topducontext.h:59
KDEVPLATFORMLANGUAGE_EXPORT QList< IndexedDeclaration > collectAllVersions(Declaration *decl)
Uses the persistent symbol table to find all occurrences of this declaration, based on its identifier...
Definition: duchainutils.cpp:454
QVector< Import > importedParentContexts() const override
Returns the list of imported parent contexts for this context.
Definition: topducontext.cpp:1024
virtual bool shouldRespectFile(const IndexedString &url)
Override this to decide whether a file should be respect while computation.
Definition: usescollector.cpp:127
void updateContextForUrl(const IndexedString &document, TopDUContext::Features minFeatures, QObject *notifyReady=nullptr, int priority=1) const
Makes sure the standard-context for the given url is up-to-date.
Definition: duchain.cpp:1839
KDEVPLATFORMLANGUAGE_EXPORT QList< Declaration * > overriders(const Declaration *currentClass, const Declaration *overriddenDeclaration, uint &maxAllowedSteps)
Gets all functions that override the function overriddenDeclaration, starting the search at currentCl...
Definition: duchainutils.cpp:530
int size() const
A helper base-class for collecting the top-contexts that contain all uses of a declaration The most i...
Definition: usescollector.h:33
bool isProxyContext() const
A language-specific flag used by C++ to mark one context as a proxy of another.
Definition: parsingenvironment.cpp:177
QExplicitlySharedDataPointer< ParsingEnvironmentFile > parsingEnvironmentFile() const
Definition: topducontext.cpp:567
QList< QExplicitlySharedDataPointer< ParsingEnvironmentFile > > importers() const
Returns the parsing-environment information of all importers of the coupled TopDUContext.
Definition: parsingenvironment.cpp:219
Represents a single declaration in a definition-use chain.
Definition: declaration.h:51
void reserve(int alloc)
virtual bool needsUpdate(const ParsingEnvironment *environment=nullptr) const
Can additionally use language-specific information to decide whether the top-context that has this da...
Definition: parsingenvironment.cpp:87
iterator insert(const Key &key, const T &value)
void setCollectDefinitions(bool collectDefinition)
If this is true, all definitions are loaded too, and part of the processed declarations.
Definition: usescollector.cpp:112
int size() const
iterator end()
Features features() const
Returns the currently active features of this top-context. The features will include AST if ast() is ...
Definition: topducontext.cpp:605
Represents a declaration only by its global indices.
Definition: indexeddeclaration.h:33
iterator find(const Key &key)
const IndexedString identifier() const
Definition: identifier.cpp:520
void collectImporters(ImportanceChecker &checker, ParsingEnvironmentFile *current, QSet< ParsingEnvironmentFile * > &visited, QSet< ParsingEnvironmentFile * > &collected)
Definition: usescollector.cpp:55
When this is given, only function-declarations are returned.
Definition: ducontext.h:128
KDEVPLATFORMLANGUAGE_EXPORT Declaration * overridden(const Declaration *decl)
Returns the declaration that is overridden by the given one, or zero.
Definition: duchainutils.cpp:587
Declaration * declaration() const
Definition: indexeddeclaration.cpp:44
TopDUContext * topContext() const override
Convenience-function that returns the top-context.
Definition: parsingenvironment.cpp:150
KDevelop::IndexedString url() const override
Definition: parsingenvironment.cpp:81
void setCollectOverloads(bool collect)
If this is true, the complete overload-chain is computed, and the uses of all overloaded functions to...
Definition: usescollector.cpp:107
void progressSignal(uint, uint)
bool contains(const T &value) const
bool startsWith(const QString &s, Qt::CaseSensitivity cs) const
This represents all information about a specific parsed file that is needed to match the file to a pa...
Definition: parsingenvironment.h:118
static Identifier destructorForName(const Identifier &name)
Definition: usescollector.cpp:44
void setProcessDeclarations(bool process)
Use this to set whether processUses should also be called on contexts that only contain a declaration...
Definition: usescollector.cpp:102
void allImportedFiles(ParsingEnvironmentFilePointer file, QSet< IndexedString > &set, QSet< ParsingEnvironmentFilePointer > &visited)
The returned set does not include the file itself.
Definition: usescollector.cpp:80
void setCollectConstructors(bool process)
If the searched declaration is a class, this can be used to decide whether constructors searched as w...
Definition: usescollector.cpp:97
Definition: abstractfunctiondeclaration.cpp:27
UsesCollector(IndexedDeclaration declaration)
Definition: usescollector.cpp:339
const_iterator insert(const T &value)
static Declaration * definition(const Declaration *decl)
Find the definition for the given declaration, if one exists.
Definition: functiondefinition.cpp:85
QList< ParsingEnvironmentFilePointer > allEnvironmentFiles(const IndexedString &document)
Returns the list of the environment-infos of all versions of the given document.
Definition: duchain.cpp:1515
QExplicitlySharedDataPointer< ParsingEnvironmentFile > ParsingEnvironmentFilePointer
Definition: duchain.h:40
void processUsesSignal(const KDevelop::ReferencedTopDUContext &)
IndexedDeclaration declaration() const
Definition: usescollector.cpp:475
void maximumProgressSignal(uint)
KDEVPLATFORMLANGUAGE_EXPORT bool contextHasUse(DUContext *context, Declaration *declaration)
Returns whether the given context or any of its child-contexts contain a use of the given declaration...
Definition: duchainutils.cpp:561
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Wed Jan 20 2021 23:38:35 by doxygen 1.8.16 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2021 The KDE developers.
Generated on Wed Jan 20 2021 23:38:35 by doxygen 1.8.16 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.