The fixits have own ranges/locations and thus might address more than
one file.
Change-Id: I5ee59944bef588e763a91f054a60823593373a0e
Reviewed-by: David Schulz <david.schulz@qt.io>
So far we have assumed that:
1) The main diagnostic explains the issue.
2) The child diagnostics might have fixits attached that use the
imperative in the text. Because of this we made the fixit texts
clickable.
As it turns out, the main diagnostic itself also might have fixits
attached, as the following example shows.
// Parse solely with the warning option "-Weverything"
template <typename T> struct C {};
C<C<int>> bla;
...which leads to
warning: consecutive right angle brackets are incompatible with C++98
(use '> >')
...which has no further child diagnostics, but provides a fixit.
The problem with this case is that it is not obvious for the user that
clicking the text will fix the issue since no imperative is used at
start of the text. For now, handle this case by making the text of the
main diagnostic clickable, too. But if we encounter more cases like
this, we probably should visualize the "you can apply the fix by
clicking here" concept differently.
Change-Id: Ia64e9821df783cba13d32395fab19251feca0398
Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
The number of child diagnostics (notes) can get quite high, consider:
error: no matching function for call to 'someFunction'
note: candidate function not viable: no known conversation from 'X' to 'Y1'
note: candidate function not viable: no known conversation from 'X' to 'Y2'
...
If there are more than 10 child diagnostics (notes), show only the first
7, an ellipsis and the last 3 of them.
Change-Id: Id74e60f5872fb9aab0cfcb956e9b740456937dac
Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
...by introducing a custom tooltip widget for diagnostics.
Locations and fixits of child diagnostics are presented as clickable
links, leading to that position in the editor or to the execution of
that fix it.
Change-Id: I83e801e22d0421dd29275e333e5dd91587885cf1
Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>