- 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: slightly reduce memory usage
- 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 "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 "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"
- fix: MinGW-w64 gcc displayed as "MinGW GCC"
- enhancement: Deduce type info for "auto" in some simple cases for stl containers.

View File

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

View File

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

View File

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