From 94e955b07a71798c51d9bd9ad3ad6c585fcb3364 Mon Sep 17 00:00:00 2001 From: Roy Qu Date: Wed, 25 Oct 2023 18:58:45 +0800 Subject: [PATCH] - fix: If the integrated gcc compiler is add to path, auto find compilers will find in twice. (Windows) --- NEWS.md | 1 + RedPandaIDE/editor.cpp | 9 +++++++++ RedPandaIDE/parser/cppparser.cpp | 10 +++++----- RedPandaIDE/settings.cpp | 4 +++- 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/NEWS.md b/NEWS.md index f3459b0a..abf47888 100644 --- a/NEWS.md +++ b/NEWS.md @@ -19,6 +19,7 @@ Red Panda C++ Version 2.26 - fix: Macros that defined by the compiler are not correctly syntax-colored and tooltiped. - fix: Code suggestion for identifiers after '*' (eg. 3 * item->price) can't correct. - fix: C++ compiler atrribute '[[xxx]]' are not correctly handled. + - fix: If the integrated gcc compiler is add to path, auto find compilers will find in twice. (Windows) Red Panda C++ Version 2.25 diff --git a/RedPandaIDE/editor.cpp b/RedPandaIDE/editor.cpp index 26dd2b4c..98f781c1 100644 --- a/RedPandaIDE/editor.cpp +++ b/RedPandaIDE/editor.cpp @@ -2331,7 +2331,16 @@ QStringList Editor::getExpressionAtPosition( } break; case LastSymbolType::AmpersandSign: // before '&': + { + QChar ch=token.front(); + if (isIdentChar(ch) + || ch.isDigit() + || ch == '.' + || ch == ')' ) { + result.pop_front(); + } return result; + } break; case LastSymbolType::ParenthesisMatched: //before '()' // if (token == ".") { diff --git a/RedPandaIDE/parser/cppparser.cpp b/RedPandaIDE/parser/cppparser.cpp index 7e28ff83..32acda4e 100644 --- a/RedPandaIDE/parser/cppparser.cpp +++ b/RedPandaIDE/parser/cppparser.cpp @@ -4397,8 +4397,8 @@ void CppParser::internalParse(const QString &fileName) QStringList preprocessResult = mPreprocessor.result(); #ifdef QT_DEBUG - stringsToFile(mPreprocessor.result(),QString("r:\\preprocess-%1.txt").arg(extractFileName(fileName))); - mPreprocessor.dumpDefinesTo("r:\\defines.txt"); +// stringsToFile(mPreprocessor.result(),QString("r:\\preprocess-%1.txt").arg(extractFileName(fileName))); +// mPreprocessor.dumpDefinesTo("r:\\defines.txt"); // mPreprocessor.dumpIncludesListTo("r:\\includes.txt"); #endif //qDebug()<<"preprocess"<=0;i--) { - folder = pathList[i]; + folder = QFileInfo(pathList[i]).absoluteFilePath(); if (searched.contains(folder)) continue; searched.insert(folder); @@ -3134,11 +3134,13 @@ void Settings::CompilerSets::findSets() #ifdef Q_OS_WIN folder = includeTrailingPathDelimiter(mSettings->dirs().appDir())+"MinGW32"+QDir::separator()+"bin"; + folder = QFileInfo(folder).absoluteFilePath(); if (!searched.contains(folder)) { addSets(folder); searched.insert(folder); } folder = includeTrailingPathDelimiter(mSettings->dirs().appDir())+"MinGW64"+QDir::separator()+"bin"; + folder = QFileInfo(folder).absoluteFilePath(); if (!searched.contains(folder)) { addSets(folder); searched.insert(folder);