Commit Graph

18 Commits

Author SHA1 Message Date
Ivan Donchevskii
95aa52707d Clang: Add links to web pages in Clang-Tidy configuration
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>
2018-05-31 12:43:45 +00:00
Nikolai Kosjar
8c8033b438 Clang: Link to documentation for tidy/clazy checks
...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>
2018-05-24 12:37:09 +00:00
Nikolai Kosjar
8639cfcc50 Clang: Fix empty category/option header in diagnostic tooltip
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>
2018-05-24 12:34:09 +00:00
Nikolai Kosjar
6afd9ecaf3 Clang: Improve diagnostic tooltips for tidy/clazy
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>
2018-05-14 09:32:09 +00:00
Eike Ziller
428fcb476b Merge remote-tracking branch 'origin/4.6'
Conflicts:
	src/libs/utils/settingsaccessor.cpp
	src/plugins/autotest/autotestplugin.cpp
	src/plugins/git/gitclient.cpp
	src/plugins/qbsprojectmanager/qbsrunconfiguration.cpp
	src/plugins/qbsprojectmanager/qbsrunconfiguration.h

Change-Id: I65f143cad18af509a2621d6c5925abbd038ea70f
2018-04-13 10:54:42 +02:00
hjk
cf4dbb4bb6 ClangSupport: Use simpler structures in some cases
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>
2018-04-06 12:55:23 +00:00
Nikolai Kosjar
56a8cd6835 Clang: Remove pointless empty line in diagnostic tooltip widget
...for diagnostics coming from clazy/tidy.

Change-Id: I73a1db74f075c1ec15ff16fc07da012451729097
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-04-06 06:57:34 +00:00
Nikolai Kosjar
b26143561a Clang: Make diagnostic display adapt to size of the info bar
Change-Id: Ibc7431234b8a68c8e2b0c3f25387de96b203c4c5
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-03-27 08:13:10 +00:00
Nikolai Kosjar
1074d97432 Clang: Avoid fragmentation in diagnostic display
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>
2017-03-24 10:52:12 +00:00
Nikolai Kosjar
dca76c9889 Clang: Leave space between category and option in diagnostic display
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>
2017-03-24 10:52:06 +00:00
Nikolai Kosjar
e373061119 Clang: Explicitly add extra space in diagnostic widget
...otherwise the one that is there will be ignored for long diagnostic
messages.

Change-Id: If9327f40b2af3315941cdb7cdf40d9e44854408b
Reviewed-by: David Schulz <david.schulz@qt.io>
2016-10-25 08:31:56 +00:00
Nikolai Kosjar
07c5cf3a83 Clang: Clean up diagnostic widget
* 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>
2016-10-21 07:33:16 +00:00
Nikolai Kosjar
9d55d8485c Clang: Show info bar for parse errors in header files
...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>
2016-10-11 14:01:14 +00:00
hjk
728b914727 CppEditor: Use full tooltip in ClangTextMark
Change-Id: I39cc64acbdbcd5e5156e1514acaf9674a91e81a4
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2016-07-25 13:25:16 +00:00
Nikolai Kosjar
ed8b910202 Clang: Honor fixits own locations in ClangFixItOperation
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>
2016-07-08 08:22:37 +00:00
Nikolai Kosjar
a1071b5066 Clang: Handle fixits of main diagnostic in tooltip
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>
2016-02-18 13:01:44 +00:00
Nikolai Kosjar
985309afbd Clang: Limit number of child diagnostics in tooltips
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>
2016-02-16 13:08:52 +00:00
Nikolai Kosjar
b064b06759 Clang: Display also child diagnostics in tooltips
...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>
2016-02-12 11:54:09 +00:00