From a768d7411698f9fafa52be3c0971977a2111849e Mon Sep 17 00:00:00 2001 From: Roy Qu Date: Mon, 27 Feb 2023 08:53:39 +0800 Subject: [PATCH] - enhancement: Syntax check for assembly files. Don't show debug tips in cpu info dialog --- NEWS.md | 1 + RedPandaIDE/compiler/compiler.cpp | 3 +++ RedPandaIDE/compiler/stdincompiler.cpp | 8 ++++++++ RedPandaIDE/editor.cpp | 6 ++++-- RedPandaIDE/mainwindow.cpp | 4 ++-- 5 files changed, 18 insertions(+), 4 deletions(-) diff --git a/NEWS.md b/NEWS.md index ec3f7b98..79cf5238 100644 --- a/NEWS.md +++ b/NEWS.md @@ -13,6 +13,7 @@ Red Panda C++ Version 2.15 - fix: Search/replace with regex is not correctly handled. - enhancement: Show descriptions mouse tip for assebmly instructions. (editor / cpu info dialog) - fix: When completing resigter names, an extra '%' is wrongly added. + - enhancement: Syntax check for assembly files. Red Panda C++ Version 2.14 diff --git a/RedPandaIDE/compiler/compiler.cpp b/RedPandaIDE/compiler/compiler.cpp index d7d8f112..267706ff 100644 --- a/RedPandaIDE/compiler/compiler.cpp +++ b/RedPandaIDE/compiler/compiler.cpp @@ -98,6 +98,9 @@ QString Compiler::getFileNameFromOutputLine(QString &line) { if (temp.compare("", Qt::CaseInsensitive)==0 ) { temp = mFilename; return temp; + } else if (temp.compare("{standard input}", Qt::CaseInsensitive)==0 ) { + temp = mFilename; + return temp; } QFileInfo fileInfo(temp); diff --git a/RedPandaIDE/compiler/stdincompiler.cpp b/RedPandaIDE/compiler/stdincompiler.cpp index e5dbf6d1..66435123 100644 --- a/RedPandaIDE/compiler/stdincompiler.cpp +++ b/RedPandaIDE/compiler/stdincompiler.cpp @@ -54,6 +54,14 @@ bool StdinCompiler::prepareForCompile() strFileType = "C"; mCompiler = compilerSet()->CCompiler(); break; + case FileType::GAS: + mArguments += " -x assembler - "; + mArguments += getCCompileArguments(mOnlyCheckSyntax); + mArguments += getCIncludeArguments(); + mArguments += getProjectIncludeArguments(); + strFileType = "GAS"; + mCompiler = compilerSet()->CCompiler(); + break; case FileType::CppSource: case FileType::CppHeader: case FileType::CHeader: diff --git a/RedPandaIDE/editor.cpp b/RedPandaIDE/editor.cpp index 5b0f4673..cb067d30 100644 --- a/RedPandaIDE/editor.cpp +++ b/RedPandaIDE/editor.cpp @@ -1903,7 +1903,8 @@ void Editor::onTooltipTimer() break; case TipType::Identifier: if (pMainWindow->debugger()->executing() && !pMainWindow->debugger()->inferiorRunning()) - s = getWordAtPosition(this,p, pBeginPos,pEndPos, WordPurpose::wpEvaluation); // debugging + if (mParentPageControl) + s = getWordAtPosition(this,p, pBeginPos,pEndPos, WordPurpose::wpEvaluation); // debugging else if (!mCompletionPopup->isVisible() && !mHeaderCompletionPopup->isVisible()) { expression = getExpressionAtPosition(p); @@ -4901,7 +4902,8 @@ void Editor::checkSyntaxInBack() return; if (!syntaxer()) return; - if (syntaxer()->language()!=QSynedit::ProgrammingLanguage::CPP) + if (syntaxer()->language()!=QSynedit::ProgrammingLanguage::CPP + && syntaxer()->language()!=QSynedit::ProgrammingLanguage::ATTAssembly) return; pMainWindow->checkSyntaxInBack(this); } diff --git a/RedPandaIDE/mainwindow.cpp b/RedPandaIDE/mainwindow.cpp index 1966acb3..8e11af16 100644 --- a/RedPandaIDE/mainwindow.cpp +++ b/RedPandaIDE/mainwindow.cpp @@ -1873,14 +1873,14 @@ void MainWindow::checkSyntaxInBack(Editor *e) if (!pSettings->editor().syntaxCheck()) { return; } -// if not devEditor.AutoCheckSyntax then -// Exit; + //not c or cpp file FileType fileType = getFileType(e->filename()); if (fileType != FileType::CSource && fileType != FileType::CppSource && fileType != FileType::CHeader && fileType != FileType::CppHeader + && fileType != FileType::GAS ) return; if (mCompilerManager->backgroundSyntaxChecking())