diff options
Diffstat (limited to 'plugins/haskell/haskelleditorwidget.cpp')
-rw-r--r-- | plugins/haskell/haskelleditorwidget.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/plugins/haskell/haskelleditorwidget.cpp b/plugins/haskell/haskelleditorwidget.cpp index 8d052a9..6454d82 100644 --- a/plugins/haskell/haskelleditorwidget.cpp +++ b/plugins/haskell/haskelleditorwidget.cpp @@ -25,11 +25,16 @@ #include "haskelleditorwidget.h" +#include "haskellconstants.h" #include "haskelltokenizer.h" +#include <coreplugin/icore.h> +#include <coreplugin/infobar.h> +#include <texteditor/textdocument.h> #include <utils/textutils.h> #include <QTextBlock> +#include <QTimer> using namespace TextEditor; @@ -63,6 +68,26 @@ Utils::optional<Token> HaskellEditorWidget::symbolAt(QTextDocument *doc, int pos return Utils::nullopt; } +void HaskellEditorWidget::showFailedToStartStackError(const QString &stackExecutable, + TextEditorWidget *widget) +{ + static const char id[] = "Haskell.FailedToStartStack"; + Core::IDocument *document = widget->textDocument(); + if (!document->infoBar()->containsInfo(id)) { + Core::InfoBarEntry info( + id, + tr("Failed to start Haskell Stack \"%1\". Make sure you have stack installed and configured in the options.") + .arg(stackExecutable)); + info.setCustomButtonInfo(Core::ICore::msgShowOptionsDialog(), [document] { + QTimer::singleShot(0, Core::ICore::instance(), [document] { + document->infoBar()->removeInfo(id); + Core::ICore::showOptionsDialog(Constants::OPTIONS_GENERAL); + }); + }); + document->infoBar()->addInfo(info); + } +} + Utils::Link HaskellEditorWidget::findLinkAt(const QTextCursor &cursor, bool resolveTarget, bool inNextSplit) { |