- change: Default value of option "Editors share one code analyzer" is ON

- change: Default value of option "Auto clear symbols in hidden editors" is OFF
  - minor fix
This commit is contained in:
Roy Qu 2022-11-30 09:54:23 +08:00
parent ba1e100ab4
commit bb2532a2ef
4 changed files with 33 additions and 31 deletions

View File

@ -6,8 +6,8 @@ Red Panda C++ Version 2.5
- enhancement: project's custom compile include/lib/bin directory is under folder of the app, save them using the path relative to the app - enhancement: project's custom compile include/lib/bin directory is under folder of the app, save them using the path relative to the app
- enhancement: slightly reduce memory usage - enhancement: slightly reduce memory usage
- enhancement: Options -> editor -> custom C/C++ type keywords page - enhancement: Options -> editor -> custom C/C++ type keywords page
- change: Default value of option "Editors share one code analyzer" is ON if available physical memory <= 32G - change: Default value of option "Editors share one code analyzer" is ON
- change: Default value of option "Auto clear symbols in hidden editors" is ON if number of CPU cores > 8 and "Editors share one code analyzer" is on - change: Default value of option "Auto clear symbols in hidden editors" is OFF
- enhancement: show completion suggest for "namespace" after "using" - enhancement: show completion suggest for "namespace" after "using"
- fix: MinGW-w64 gcc displayed as "MinGW GCC" - fix: MinGW-w64 gcc displayed as "MinGW GCC"
- enhancement: Deduce type info for "auto" in some simple cases for stl containers. - enhancement: Deduce type info for "auto" in some simple cases for stl containers.

View File

@ -1068,10 +1068,11 @@ QString CppParser::prettyPrintStatement(const PStatement& statement, const QStri
return result; return result;
} }
QString CppParser::getFirstTemplateParam(const PStatement& statement, QString CppParser::getTemplateParam(const PStatement& statement,
const QString& filename, const QString& filename,
const QString& phrase, const QString& phrase,
const PStatement& currentScope) int index,
const PStatement& currentScope)
{ {
if (!statement) if (!statement)
return ""; return "";
@ -1079,7 +1080,7 @@ QString CppParser::getFirstTemplateParam(const PStatement& statement,
return ""; return "";
if (statement->type == phrase) // prevent infinite loop if (statement->type == phrase) // prevent infinite loop
return ""; return "";
return findFirstTemplateParamOf(filename,statement->type, currentScope); return doFindTemplateParamOf(filename,statement->type,index,currentScope);
} }
int CppParser::getTemplateParamStart(const QString &s, int startAt, int index) int CppParser::getTemplateParamStart(const QString &s, int startAt, int index)
@ -2042,7 +2043,7 @@ QString CppParser::doFindTemplateParamOf(const QString &fileName, const QString
PStatement scopeStatement = currentScope; PStatement scopeStatement = currentScope;
PStatement statement = findStatementOf(fileName,s,currentScope); PStatement statement = findStatementOf(fileName,s,currentScope);
return getFirstTemplateParam(statement,fileName, phrase, currentScope); return getTemplateParam(statement,fileName, phrase,index, currentScope);
} }
int CppParser::getCurrentBlockEndSkip() int CppParser::getCurrentBlockEndSkip()
@ -3248,6 +3249,7 @@ void CppParser::handleStructs(bool isTypedef)
// normal class/struct decl // normal class/struct decl
} else { } else {
bool templateSpecialization=false;
PStatement firstSynonym; PStatement firstSynonym;
// Add class/struct name BEFORE opening brace // Add class/struct name BEFORE opening brace
if (mTokenizer[mIndex]->text.front() != '{') { if (mTokenizer[mIndex]->text.front() != '{') {

View File

@ -410,8 +410,8 @@ private:
int getCurrentBlockEndSkip(); int getCurrentBlockEndSkip();
int getCurrentInlineNamespaceEndSkip(); int getCurrentInlineNamespaceEndSkip();
PStatement getCurrentScope(); // gets last item from last level PStatement getCurrentScope(); // gets last item from last level
QString getFirstTemplateParam(const PStatement& statement, const QString& filename, QString getTemplateParam(const PStatement& statement, const QString& filename,
const QString& phrase, const PStatement& currentScope); const QString& phrase, int index, const PStatement& currentScope);
int getTemplateParamStart(const QString& s, int startAt, int index); int getTemplateParamStart(const QString& s, int startAt, int index);
int getTemplateParamEnd(const QString& s, int startAt); int getTemplateParamEnd(const QString& s, int startAt);

View File

@ -4002,31 +4002,31 @@ void Settings::CodeCompletion::doLoad()
bool shouldShare= true; bool shouldShare= true;
bool doClear = false; bool doClear = false;
#ifdef Q_OS_WIN //#ifdef Q_OS_WIN
MEMORYSTATUSEX statex; // MEMORYSTATUSEX statex;
statex.dwLength = sizeof (statex); // statex.dwLength = sizeof (statex);
GlobalMemoryStatusEx (&statex); // GlobalMemoryStatusEx (&statex);
if (statex.ullAvailPhys > (long long int)24*1024*1024*1024) { // if (statex.ullAvailPhys > (long long int)32*1024*1024*1024) {
shouldShare = false; // shouldShare = false;
} // }
if (shouldShare) { //// if (shouldShare) {
SYSTEM_INFO info; //// SYSTEM_INFO info;
GetSystemInfo(&info); //// GetSystemInfo(&info);
if (info.dwNumberOfProcessors>8 && info.dwProcessorType) { //// if (info.dwNumberOfProcessors>8 && info.dwProcessorType) {
doClear = true; //// doClear = true;
} //// }
} //// }
#elif defined(Q_OS_LINUX) //#elif defined(Q_OS_LINUX)
struct sysinfo si; // struct sysinfo si;
sysinfo(&si); // sysinfo(&si);
if (si.freeram > (long long int)24*1024*1024*1024) { // if (si.freeram > (long long int)24*1024*1024*1024) {
shouldShare = false; // shouldShare = false;
} // }
#endif //#endif
mClearWhenEditorHidden = boolValue("clear_when_editor_hidden",doClear); mClearWhenEditorHidden = boolValue("clear_when_editor_hidden",doClear);
mShareParser = boolValue("share_parser",shouldShare); mShareParser = boolValue("share_parser",shouldShare);
} }