In favor of the FilePath/Link ones.
Change-Id: I5caf9e0f8de304ff4ee12329557aa50a6f3a0c69
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: David Schulz <david.schulz@qt.io>
It's helpful to know whether a particular issue came from clangd,
libclang, or somewhere else.
Change-Id: I9e00d79ffe630a91028c2aeff219571e9979dbee
Reviewed-by: David Schulz <david.schulz@qt.io>
There was no proper separation of responsibilities between these
plugins. In particular, CppTools had lots of editor-related
functionality, so it's not clear why it was separated out in the first
place.
In fact, for a lot of code, it seemed quite arbitrary where it was put
(just one example: switchHeaderSource() was in CppTools, wheras
switchDeclarationDefinition() was in CppEditor).
Merging the plugins will enable us to get rid of various convoluted
pseudo-abstractions that were only introduced to keep up the artificial
separation.
Change-Id: Iafc3bce625b4794f6d4aa03df6cddc7f2d26716a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Diagnostics from clang-tidy and clazy do not take this route anymore.
Change-Id: Ifca2d9861d69dda94638277ec1210d28a3350b12
Reviewed-by: David Schulz <david.schulz@qt.io>
The code locations might no longer be correct.
Fixes: QTCREATORBUG-21818
Change-Id: I866a29d2fd63ff65cf33168024f7788c5f6e3547
Reviewed-by: David Schulz <david.schulz@qt.io>
... by the customary ::Internal.
It adds only noise on the user side and conflicts regularly with
the top-level ::Utils namespace.
Remove a (now) duplicated definition of setLastSentDocumentRevision().
Plus minor namespace related fixes.
There are still minor conflicts between Utils::Text and
ClangCodeModel::Text
Change-Id: I2e8df6b3c6c3599192774032822ee7e778355bba
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
...that opens the documentation page for the current diagnostic.
Change-Id: I398fdc82bb118a80536acbb12420a9bac84e66c9
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Recent adaptations to Qt 5.13's API deprecations require using APIs
which were introduces in Qt 5.11.
Change-Id: I6c077d824c9ce716e019543b290c355a5d512fad
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Do not use functions that are not supported with
the minimum supported Qt for building QC.
Partially reverts 963dc84cc5.
Change-Id: Ife03143a7cf5a8f428754040e7004efe42d70a8a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
...from the diagnostic configuration.
If no custom diagnostic configuration is set in Projects Mode > Clang,
one is created and set for the current project. Otherwise the current
custom diagnostic set in the project settings is modified.
Change-Id: I5c48280c90f0e807e7333122d504dda302a8b0a9
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
...as selecting text in the tooltip was difficult and eventually got
disabled due to other problems - see
d58c0a9ac8.
This adds support for actions in TextMarks. They are displayed as
QToolButtons in a dedicated column in the tooltip.
Change-Id: I84ee3c3e4af573a80953786881d1333b00e4200c
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
This is for a follow-up change that will allow to copy the diagnostic
text from the tooltip to the clipboard.
Change-Id: Iad5343a819c84ca83d562f69dcf2f50e1d4785c4
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Disallow text selection for the code model tool tips because dragging
the selection somewhere crashes.
Task-number: QTCREATORBUG-21430
Change-Id: I3aed4e16bf429162258d2dfafaa45fff25ba700a
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
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>