Context browser: fix handleRect for non-symbol tooltips

Authored by kossebau on Oct 14 2018, 5:30 PM.

Description

Context browser: fix handleRect for non-symbol tooltips

Summary:
The ContextBrowserPlugin::showToolTip() tried to calculate the handle
rect for the tooltip in all cases from DUChainUtils::itemUnderCursor(),
which currently in case of no symbol repots a valid empty range at
position 0,0.

This results in bogus active zones for the tooltips for problem tooltips,
but also languages where the language support plugin has many items not
in the DUChain (like the CMake support plugin).

This patches fixes this by
a) changing ILanguageSupport::specialLanguageObjectNavigationWidget()
to report not only the widget but also which document range the object
covers for which the widget was created.
b) collect the ranges from all places from which the tooltip widget is
fetched

Test Plan:
Tooltips for problems and cmake symbols behave now similar to those for e.g.
C++ symbols. E.g.. tooltips for items at the bottom of the screen, where the
tooltip is shown above, the tooltip now can be entered by the mouse and does
not disappear on a move.
C++ language tooltips work as before.

Reviewers: KDevelop, kfunk

Reviewed By: KDevelop, kfunk

Subscribers: kfunk, brauch, kdevelop-devel

Tags: KDevelop

Differential Revision: https://phabricator.kde.org/D16203

Details

Committed
kossebauOct 18 2018, 10:28 AM
Reviewer
KDevelop
Differential Revision
D16203: Context browser: fix handleRect for non-symbol tooltips
Parents
R32:27eaf33c3c52: Prevent QWebEngine from overriding signal handlers
Branches
Unknown
Tags
Unknown