From cd17c7cbcafd91e50bc444b856d899ccb475cfed Mon Sep 17 00:00:00 2001 From: Roy Qu Date: Sun, 26 Mar 2023 19:05:38 +0800 Subject: [PATCH] - enhancement: Improve code completion suggestion for arrays. --- NEWS.md | 1 + RedPandaIDE/parser/cppparser.cpp | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/NEWS.md b/NEWS.md index 83bb26b6..653d170f 100644 --- a/NEWS.md +++ b/NEWS.md @@ -16,6 +16,7 @@ Red Panda C++ Version 2.19 - change: Use ctrl+K,ctrl+S as the shortcut for "save all". - fix: "Run all problem cases" with project is not correctly handled. - fix: When adding files to project and there'are duplicates, the warning info is not complete. + - enhancement: Improve code completion suggestion for arrays. Red Panda C++ Version 2.18 diff --git a/RedPandaIDE/parser/cppparser.cpp b/RedPandaIDE/parser/cppparser.cpp index 82d0fea5..25c36318 100644 --- a/RedPandaIDE/parser/cppparser.cpp +++ b/RedPandaIDE/parser/cppparser.cpp @@ -5061,6 +5061,13 @@ PEvalStatement CppParser::doCreateEvalVariable( pointerLevel, templateParams); } + if (!varStatement->args.isEmpty()) { + int j = 0; + while ((j = varStatement->args.indexOf("[", j)) != -1) { + ++j; + pointerLevel++; + } + } // qDebug()<<"parse ..."<( baseType,