fix: function tips not correctly displayed

This commit is contained in:
Roy Qu 2024-04-05 22:43:07 +08:00
parent 12153bf16a
commit 29ed064b91
2 changed files with 3 additions and 4 deletions

View File

@ -156,7 +156,7 @@ QList<PStatement> CppParser::getListOfFunctions(const QString &fileName, const Q
QStringList expression = splitExpression(phrase);
PStatement scopeStatement = doFindScopeStatement(fileName,line);
int pos = 0;
PEvalStatement evalStatement = doEvalExpression(fileName, expression, pos, scopeStatement, PEvalStatement(), false, true);
PEvalStatement evalStatement = doEvalExpression(fileName, expression, pos, scopeStatement, PEvalStatement(), true, true);
if (!evalStatement)
return result;
PStatement statement = evalStatement->baseStatement;

View File

@ -803,18 +803,17 @@ void CppPreprocessor::removeGCCAttribute(const QString &line, QString &newLine,
void CppPreprocessor::openInclude(QString fileName)
{
fileName.squeeze();
PFileIncludes fileIncludes = getFileIncludesEntry(fileName);
if (fileIncludes) {
fileName = fileIncludes->baseFile;
} else {
fileName.squeeze();
}
if (mIncludes.size()>0) {
PParsedFile topFile = mIncludes.front();
if (topFile->fileIncludes->includeFiles.contains(fileName)) {
PParsedFile innerMostFile = mIncludes.back();
innerMostFile->fileIncludes->includeFiles.insert(fileName, false);
return; //already included
}
for (PParsedFile& parsedFile:mIncludes) {