Issue #194 - fix: Function tips contains functions that not in the scope.
This commit is contained in:
parent
f79da84224
commit
9df669ba08
|
@ -806,9 +806,7 @@ QStringList CppParser::getFileDirectIncludes(const QString &filename)
|
|||
|
||||
}
|
||||
|
||||
QSet<QString> CppParser::getIncludedFiles(const QString &filename)
|
||||
{
|
||||
QMutexLocker locker(&mMutex);
|
||||
QSet<QString> CppParser::internalGetIncludedFiles(const QString &filename) const {
|
||||
QSet<QString> list;
|
||||
if (mParsing)
|
||||
return list;
|
||||
|
@ -825,6 +823,12 @@ QSet<QString> CppParser::getIncludedFiles(const QString &filename)
|
|||
return list;
|
||||
}
|
||||
|
||||
QSet<QString> CppParser::getIncludedFiles(const QString &filename)
|
||||
{
|
||||
QMutexLocker locker(&mMutex);
|
||||
return internalGetIncludedFiles(filename);
|
||||
}
|
||||
|
||||
QSet<QString> CppParser::getFileUsings(const QString &filename)
|
||||
{
|
||||
QMutexLocker locker(&mMutex);
|
||||
|
@ -4584,8 +4588,11 @@ QList<PStatement> CppParser::getListOfFunctions(const QString &fileName, int lin
|
|||
{
|
||||
QList<PStatement> result;
|
||||
StatementMap children = mStatementList.childrenStatements(scopeStatement);
|
||||
QSet<QString> includedFiles = internalGetIncludedFiles(fileName);
|
||||
for (const PStatement& child:children) {
|
||||
if (statement->command == child->command) {
|
||||
if (!includedFiles.contains(fileName))
|
||||
continue;
|
||||
if (line < child->line && (child->fileName == fileName))
|
||||
continue;
|
||||
result.append(child);
|
||||
|
|
|
@ -277,6 +277,7 @@ private:
|
|||
QList<PStatement> getListOfFunctions(const QString& fileName, int line,
|
||||
const PStatement& statement,
|
||||
const PStatement& scopeStatement) const;
|
||||
QSet<QString> internalGetIncludedFiles(const QString &filename) const;
|
||||
PStatement findMacro(const QString& phrase, const QString& fileName) const;
|
||||
PStatement findMemberOfStatement(
|
||||
const QString& filename,
|
||||
|
|
Loading…
Reference in New Issue