TextEditor: Implement BaseHoverHandler::identifyMatch()

The extra selection tooltips are a good default for a hover match. We
use that in the basic plaintext editor to show, for example, syntax
errors in XML documents, detected during extra compiler runs.

Change-Id: Ib7f755c482ebc04148567105e4779324799fb670
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
This commit is contained in:
Ulf Hermann
2016-01-22 11:48:22 +01:00
parent 654aa3a0d7
commit 0dff03e6fe
3 changed files with 10 additions and 1 deletions

View File

@@ -31,6 +31,7 @@
#include "texteditorconstants.h"
#include "texteditorplugin.h"
#include "texteditorsettings.h"
#include "basehoverhandler.h"
#include <coreplugin/coreconstants.h>
#include <coreplugin/infobar.h>
@@ -60,6 +61,7 @@ PlainTextEditorFactory::PlainTextEditorFactory()
setDisplayName(qApp->translate("OpenWith::Editors", Core::Constants::K_DEFAULT_TEXT_EDITOR_DISPLAY_NAME));
addMimeType(QLatin1String(TextEditor::Constants::C_TEXTEDITOR_MIMETYPE_TEXT));
addMimeType(QLatin1String("text/css")); // for some reason freedesktop thinks css is text/x-csrc
addHoverHandler(new BaseHoverHandler);
setDocumentCreator([]() { return new TextDocument(Core::Constants::K_DEFAULT_TEXT_EDITOR_ID); });
setEditorWidgetCreator([]() { return new PlainTextEditorWidget; });