Each Clang-Tidy check get the separate link except
clang-analyzer which has only a whole group page.
Change-Id: I0b63cce8475109812280d9d44ac2d36aaa66e03b
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
...in the diagnostic tooltips.
The "enable option" in the top right of the tooltip (e.g.
"-Wclazy-range-loop") is now clickable and will open the documentation
page for clazy and tidy checks.
Change-Id: I6e7e2d1fc39b3b6ccee328276b7a52ae4809b567
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
We assumed that diagnostics from clang itself (not tidy, clazy) have
always an enable option set, but this is not true as can be easily
observed with invalid code:
bla // error: unknown type name 'bla'
Due to the assumption we were running into the
conclude-category-and-option-for-tidy-and-clazy code path, which failed
and resulted in an empty category and thus an empty line in the tooltip.
Change-Id: Ic21629a637a7b0e5736ac514dc826bdc4c0cf91d
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Introduce the header for tidy/clazy issues showing "Clang-Tidy Issue" / "Clazy
Issue" and the option that led to the warning, as for normal clang
diagnostics.
Having that, chop off the option in the text to avoid redundancy.
Change-Id: I30a87dc739faa38c51d9e1fb5b9dfc7ffb7055c5
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
The patch is mostly mechanical, but contains also a few spurious changes
from values references for some local variables, foreach -> ranged for
etc that I coulnd't resist.
Change-Id: I58f0bd972546895eb318607cbfbd7ac35caf3f23
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
A "diagnostic row" is displayed in two columns with the help of table,
one cell being the location, the other cell the diagnostic text. At
times, the location is wrapped too, which makes the whole diagnostic
display look fragmented/broken.
It looks like there is no way to avoid the wrapping of the location
column because Qt's CSS does not support the needed
style='white-space:nowrap'
Avoid the columns for a consistent display at all times.
Change-Id: I35e4a1c831f18e2bce6a4c9ed891fcae439d1a1b
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
For some diagnostics ("#include_next is a language extension"), the text
has a smaller width than the category and option together. In this case,
there is no space between category and option, which looks terse.
Change-Id: I27e4736a0d2aa527d5733c6115bc8d40fe7794e0
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
...otherwise the one that is there will be ignored for long diagnostic
messages.
Change-Id: If9327f40b2af3315941cdb7cdf40d9e44854408b
Reviewed-by: David Schulz <david.schulz@qt.io>
* Use a single QLabel - No need for all the QLabels we used. Also, a
single QLabel enables selecting and copying all the diagnostics, which
is handy when displayed in the info bar.
* Avoid call to Utils::ToolTip::hideImmediately() if the location is
clicked from the info bar.
* Simplify code and API
Change-Id: Ib991364e4d6f40ef02dada8ebbb90fe6ff8ae1a1
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
...because those errors can lead to a substantial performance/functional
regression.
The actual diagnostics (possibly with children) are shown as details in
the info bar.
The info bar can be hidden with the "Do Not Show Again" button.
Re-enabling the info bar is possible with the new editor tool bar
button.
Change-Id: I03394ff8e3c84127946b0b791930b28a385f5a46
Reviewed-by: David Schulz <david.schulz@qt.io>
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>