Clang: Make diagnostic tooltips consistent

Fix that triggering a diagnostic tooltip from the diagnostic
location/range itself (underlined text) did not show the icon on the
left and the actions/toolbuttons on the right in the tooltip.

Instead of showing the tooltip content itself, request the tooltip for
the corresponding text mark to get the extra decoration and actions.

Change-Id: I5e94aca117a761f7a798d4f4b33db6e386e54d84
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
This commit is contained in:
Nikolai Kosjar
2019-01-31 13:16:44 +01:00
parent 1a58a30685
commit c5e43d86d1
10 changed files with 43 additions and 111 deletions

View File

@@ -59,6 +59,7 @@ class HighlightScrollBarController;
namespace TextEditor {
class TextDocument;
class TextMark;
class BaseHoverHandler;
class RefactorOverlay;
struct RefactorMarker;
@@ -68,6 +69,7 @@ class IAssistProvider;
class ICodeStylePreferences;
class CompletionAssistProvider;
using RefactorMarkers = QList<RefactorMarker>;
using TextMarks = QList<TextMark *>;
namespace Internal {
class BaseTextEditorPrivate;
@@ -274,6 +276,9 @@ public:
QRegion translatedLineRegion(int lineStart, int lineEnd) const;
QPoint toolTipPosition(const QTextCursor &c) const;
void showTextMarksToolTip(const QPoint &pos,
const TextMarks &marks,
const TextMark *mainTextMark = nullptr) const;
void invokeAssist(AssistKind assistKind, IAssistProvider *provider = nullptr);