Commit Graph

10 Commits

Author SHA1 Message Date
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