From f029de304826475cc23ae0687dccab67b9293bc0 Mon Sep 17 00:00:00 2001 From: Roy Qu Date: Sat, 6 Apr 2024 10:31:08 +0800 Subject: [PATCH] - fixes #371 : Don't show completion suggestion for members of variable which type name has namespace alias; --- NEWS.md | 1 + RedPandaIDE/parser/cppparser.cpp | 11 +++-------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/NEWS.md b/NEWS.md index 18069b07..b4e98dba 100644 --- a/NEWS.md +++ b/NEWS.md @@ -123,6 +123,7 @@ Red Panda C++ Version 2.27 - fix: Don't show function prototype tip for function name that contains more than one namespace; - fix: Compiler set options "Check for stack smashing attacks (-fstack-protector)" was not correctly applied when compiling. - fix: can't jump to definition/declaration for symbols in using alias statement like "using ::printf". + - fix: Don't show completion suggestion for members of variable which type name has namespace alias; Red Panda C++ Version 2.26 - enhancement: Code suggestion for embedded std::vectors. diff --git a/RedPandaIDE/parser/cppparser.cpp b/RedPandaIDE/parser/cppparser.cpp index 42ba1fc0..de79bc34 100644 --- a/RedPandaIDE/parser/cppparser.cpp +++ b/RedPandaIDE/parser/cppparser.cpp @@ -154,13 +154,7 @@ QList CppParser::getListOfFunctions(const QString &fileName, const Q return result; QStringList expression = splitExpression(phrase); - PStatement scopeStatement = doFindScopeStatement(fileName,line); - int pos = 0; - PEvalStatement evalStatement = doEvalExpression(fileName, expression, pos, scopeStatement, PEvalStatement(), true, true); - if (!evalStatement) - return result; - PStatement statement = evalStatement->baseStatement; - + PStatement statement = doFindStatementOf(fileName, expression, line); if (!statement) return result; if (statement->kind == StatementKind::Preprocessor) { @@ -5814,7 +5808,8 @@ PStatement CppParser::doParseEvalTypeInfo( } position--; } - typeStatement = doFindStatementOf(fileName,baseType,scope); + QStringList expression = splitExpression(baseType); + typeStatement = doFindStatementOf(fileName,expression,scope); PStatement effectiveTypeStatement = typeStatement; int level=0; while (effectiveTypeStatement && (effectiveTypeStatement->kind == StatementKind::Typedef