forked from qt-creator/qt-creator
ExtraCompiler: Get rid of setCompileIssues()
This basically reverts 8643877c33.
The setCompileIssues() introduced there wasn't used anywhere.
Since the "issues" field is always empty, the updateIssues()
is no-op.
Change-Id: I7e7e5fc9778343fbaafc717b80188a65ba7adc39
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
@@ -10,9 +10,6 @@
|
||||
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
#include <coreplugin/idocument.h>
|
||||
#include <texteditor/texteditor.h>
|
||||
#include <texteditor/texteditorsettings.h>
|
||||
#include <texteditor/fontsettings.h>
|
||||
|
||||
#include <utils/asynctask.h>
|
||||
#include <utils/expected.h>
|
||||
@@ -36,7 +33,6 @@ public:
|
||||
const Project *project;
|
||||
FilePath source;
|
||||
FileNameToContentsHash contents;
|
||||
Tasks issues;
|
||||
QDateTime compileTime;
|
||||
Core::IEditor *lastEditor = nullptr;
|
||||
QMetaObject::Connection activeBuildConfigConnection;
|
||||
@@ -44,7 +40,6 @@ public:
|
||||
bool dirty = false;
|
||||
|
||||
QTimer timer;
|
||||
void updateIssues();
|
||||
|
||||
FutureSynchronizer m_futureSynchronizer;
|
||||
std::unique_ptr<TaskTree> m_taskTree;
|
||||
@@ -226,7 +221,6 @@ void ExtraCompiler::onEditorChanged(Core::IEditor *editor)
|
||||
|
||||
if (editor && editor->document()->filePath() == d->source) {
|
||||
d->lastEditor = editor;
|
||||
d->updateIssues();
|
||||
|
||||
// Handle new editor
|
||||
connect(d->lastEditor->document(), &Core::IDocument::contentsChanged,
|
||||
@@ -276,40 +270,6 @@ Environment ExtraCompiler::buildEnvironment() const
|
||||
return Environment::systemEnvironment();
|
||||
}
|
||||
|
||||
void ExtraCompiler::setCompileIssues(const Tasks &issues)
|
||||
{
|
||||
d->issues = issues;
|
||||
d->updateIssues();
|
||||
}
|
||||
|
||||
void ExtraCompilerPrivate::updateIssues()
|
||||
{
|
||||
if (!lastEditor)
|
||||
return;
|
||||
|
||||
auto widget = qobject_cast<TextEditor::TextEditorWidget *>(lastEditor->widget());
|
||||
if (!widget)
|
||||
return;
|
||||
|
||||
QList<QTextEdit::ExtraSelection> selections;
|
||||
const QTextDocument *document = widget->document();
|
||||
for (const Task &issue : std::as_const(issues)) {
|
||||
QTextEdit::ExtraSelection selection;
|
||||
QTextCursor cursor(document->findBlockByNumber(issue.line - 1));
|
||||
cursor.movePosition(QTextCursor::StartOfLine);
|
||||
cursor.movePosition(QTextCursor::EndOfLine, QTextCursor::KeepAnchor);
|
||||
selection.cursor = cursor;
|
||||
|
||||
const auto fontSettings = TextEditor::TextEditorSettings::fontSettings();
|
||||
selection.format = fontSettings.toTextCharFormat(issue.type == Task::Warning ?
|
||||
TextEditor::C_WARNING : TextEditor::C_ERROR);
|
||||
selection.format.setToolTip(issue.description());
|
||||
selections.append(selection);
|
||||
}
|
||||
|
||||
widget->setExtraSelections(TextEditor::TextEditorWidget::CodeWarningsSelection, selections);
|
||||
}
|
||||
|
||||
Utils::FutureSynchronizer *ExtraCompiler::futureSynchronizer() const
|
||||
{
|
||||
return &d->m_futureSynchronizer;
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
|
||||
#include "projectnodes.h"
|
||||
#include "project.h"
|
||||
#include "task.h"
|
||||
|
||||
#include <coreplugin/editormanager/ieditor.h>
|
||||
|
||||
@@ -67,7 +66,6 @@ protected:
|
||||
void setContent(const Utils::FilePath &file, const QByteArray &content);
|
||||
void updateCompileTime();
|
||||
Utils::Environment buildEnvironment() const;
|
||||
void setCompileIssues(const Tasks &issues);
|
||||
using ContentProvider = std::function<QByteArray()>;
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user