- change: continue to run / debug if there are compiling warnings (but no errors)
This commit is contained in:
parent
2915a862ff
commit
4634c0fbbc
1
NEWS.md
1
NEWS.md
|
@ -1,4 +1,5 @@
|
|||
Version 0.2
|
||||
- change: continue to run / debug if there are compiling warnings (but no errors)
|
||||
- enhancement: class browser syntax colors and icons
|
||||
- enhancement: function tips
|
||||
- enhancement: project support
|
||||
|
|
|
@ -222,9 +222,11 @@ void CompilerManager::onRunnerTerminated()
|
|||
p->deleteLater();
|
||||
}
|
||||
|
||||
void CompilerManager::onCompileIssue(PCompileIssue)
|
||||
void CompilerManager::onCompileIssue(PCompileIssue issue)
|
||||
{
|
||||
mCompileErrorCount ++;
|
||||
if (issue->type == CompileIssueType::Error)
|
||||
mCompileErrorCount++;
|
||||
mCompileIssueCount++;
|
||||
}
|
||||
|
||||
void CompilerManager::onSyntaxCheckFinished()
|
||||
|
@ -234,9 +236,22 @@ void CompilerManager::onSyntaxCheckFinished()
|
|||
mBackgroundSyntaxChecker=nullptr;
|
||||
}
|
||||
|
||||
void CompilerManager::onSyntaxCheckIssue(PCompileIssue)
|
||||
void CompilerManager::onSyntaxCheckIssue(PCompileIssue issue)
|
||||
{
|
||||
mSyntaxCheckErrorCount++;
|
||||
if (issue->type == CompileIssueType::Error)
|
||||
mSyntaxCheckErrorCount++;
|
||||
mSyntaxCheckIssueCount++;
|
||||
|
||||
}
|
||||
|
||||
int CompilerManager::syntaxCheckIssueCount() const
|
||||
{
|
||||
return mSyntaxCheckIssueCount;
|
||||
}
|
||||
|
||||
int CompilerManager::compileIssueCount() const
|
||||
{
|
||||
return mCompileIssueCount;
|
||||
}
|
||||
|
||||
int CompilerManager::syntaxCheckErrorCount() const
|
||||
|
|
|
@ -33,6 +33,10 @@ public:
|
|||
|
||||
int syntaxCheckErrorCount() const;
|
||||
|
||||
int compileIssueCount() const;
|
||||
|
||||
int syntaxCheckIssueCount() const;
|
||||
|
||||
private slots:
|
||||
void onRunnerTerminated();
|
||||
void onCompileFinished();
|
||||
|
@ -43,7 +47,9 @@ private slots:
|
|||
private:
|
||||
Compiler* mCompiler;
|
||||
int mCompileErrorCount;
|
||||
int mCompileIssueCount;
|
||||
int mSyntaxCheckErrorCount;
|
||||
int mSyntaxCheckIssueCount;
|
||||
Compiler* mBackgroundSyntaxChecker;
|
||||
ExecutableRunner* mRunner;
|
||||
QMutex mCompileMutex;
|
||||
|
|
|
@ -293,7 +293,7 @@ void MainWindow::updateCompileActions()
|
|||
if (e) {
|
||||
FileType fileType = getFileType(e->filename());
|
||||
if (fileType == FileType::CSource
|
||||
|| fileType == FileType::CppSource)
|
||||
|| fileType == FileType::CppSource || e->isNew())
|
||||
editorCanCompile = true;
|
||||
}
|
||||
if (mCompilerManager->compiling() || mCompilerManager->running() || mDebugger->executing()
|
||||
|
@ -2428,8 +2428,19 @@ void MainWindow::onCompileFinished()
|
|||
e->invalidate();
|
||||
}
|
||||
|
||||
// Jump to problem location, sorted by significance
|
||||
if ((mCompilerManager->compileErrorCount() > 0) && (!mCheckSyntaxInBack)) {
|
||||
//run succession task if there aren't any errors
|
||||
if (mCompileSuccessionTask && mCompilerManager->compileErrorCount()==0) {
|
||||
switch (mCompileSuccessionTask->type) {
|
||||
case MainWindow::CompileSuccessionTaskType::Run:
|
||||
runExecutable(mCompileSuccessionTask->filename);
|
||||
break;
|
||||
case MainWindow::CompileSuccessionTaskType::Debug:
|
||||
debug();
|
||||
break;
|
||||
}
|
||||
mCompileSuccessionTask.reset();
|
||||
// Jump to problem location, sorted by significance
|
||||
} else if ((mCompilerManager->compileIssueCount() > 0) && (!mCheckSyntaxInBack)) {
|
||||
// First try to find errors
|
||||
for (int i=0;i<ui->tableIssues->count();i++) {
|
||||
PCompileIssue issue = ui->tableIssues->issue(i);
|
||||
|
@ -2454,34 +2465,6 @@ void MainWindow::onCompileFinished()
|
|||
emit ui->tableIssues->doubleClicked(index);
|
||||
}
|
||||
}
|
||||
// Then try to find anything with a line number...
|
||||
// for I := 0 to CompilerOutput.Items.Count - 1 do begin
|
||||
// if not SameStr(CompilerOutput.Items[I].Caption, '') then begin
|
||||
// CompilerOutput.Selected := CompilerOutput.Items[I];
|
||||
// CompilerOutput.Selected.MakeVisible(False);
|
||||
// CompilerOutputDblClick(CompilerOutput);
|
||||
// Exit;
|
||||
// end;
|
||||
// end;
|
||||
|
||||
// Then try to find a resource error
|
||||
// if ResourceOutput.Items.Count > 0 then begin
|
||||
// ResourceOutput.Selected := ResourceOutput.Items[0];
|
||||
// ResourceOutput.Selected.MakeVisible(False);
|
||||
// CompilerOutputDblClick(ResourceOutput);
|
||||
// end;
|
||||
} else {
|
||||
if (mCompileSuccessionTask) {
|
||||
switch (mCompileSuccessionTask->type) {
|
||||
case MainWindow::CompileSuccessionTaskType::Run:
|
||||
runExecutable(mCompileSuccessionTask->filename);
|
||||
break;
|
||||
case MainWindow::CompileSuccessionTaskType::Debug:
|
||||
debug();
|
||||
break;
|
||||
}
|
||||
mCompileSuccessionTask.reset();
|
||||
}
|
||||
}
|
||||
mCheckSyntaxInBack=false;
|
||||
updateCompileActions();
|
||||
|
|
Loading…
Reference in New Issue