Bring back the text marks with annotations for diagnostics generated by
clang-tidy and clazy. They are visible as long as the file isn't
modified.
Task-number: QTCREATORBUG-23349
Change-Id: Idf6d01c67c1cc9d1e000a339441f9cf948cdc2b7
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
...that opens the documentation page for the current diagnostic.
Change-Id: I398fdc82bb118a80536acbb12420a9bac84e66c9
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Replace the filter line edit in the toolbar by a tool button that pop
ups a dialog. In the dialog, the available checkers can be
selectd/unselected to filter the diagnostic view. Also, the diagnostic
view can be limited to diagnostics with fixits so that these can be
selected and applied as the next step.
For convience, add also some context menu entries to modify the filter
with regard to the current diagnostic.
Change-Id: Ifba3028805840658d72a39516c2b02da9864d4a6
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Avoid the following issues with the diagnostic view's header:
* Clicking on the header to reverse the sorting is somewhat pointless as
there is only one column.
* It takes vertical space.
* The checkbox to select/unselect all fixits for application is hacky,
not drawn nicely on Windows and macOS and its position is somewhat
problematic as on hover the dock widgets handles are popping up.
* To check the check box, one needs to click within the check box
rectangle, which is a pretty small area of the screen.
Instead, add a proper checkbox with a label to the toolbar (apparently
this needs some adaptions to our ManhattenStyle). By positioning it
before the "Apply Fixits" button, we can streamline the work flow.
Change-Id: I4ff40c3641487428feb1cd8305470dc5219d048c
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* Disable the button when (re-)running an analysis.
* Ensure the button stays disabled when a file is saved.
Change-Id: I1140dd3938de554ea83d33c5bb490be3468d7db0
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
GCC does not realize that all cases lead to a return statement.
Change-Id: I0b6fc7b349b8dc09b739f3423121d2e760c74701
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
...to make it consistent with the DiagnosticItem.
Change-Id: I66ce41441058879ee293f9ae177e7b50d4856234
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
...so it's closer to other related data and controls (expand/collapse
marker).
The details of the fixits status are displayed in the tooltip now.
Change-Id: I9f1a9e9562572195b52a097ae9278647fecf6cb8
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Sometimes we used "issue" (treeview header, or filter line edit) and
sometimes "diagnostic" (go to next/pervious diagnostic actions).
Stick to "diagnostic" as it's more generic and avoid conflicts/confusion
with the "Issues pane".
Task-number: QTCREATORBUG-19047
Change-Id: I26b814b117a8fd475c080f0ef79c9fabc1446406
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
We sorted by line/column/text, but we should not change the order for
these items as the original order is crucial to understand the
diagnostics. For example, the clang static analyzer diagnostics provide
step by step notes to explain the main diagnostics and these does not
match the line/column order.
Change-Id: I1e7235b37eb5713b0b7135aab46124f590a1443a
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
In case the ExplainingStepItem refers to another file than the main
diagnostic, display the file name too.
Change-Id: I1df2781766dc0c7a58b451e3c96b78574d574e54
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
* Location of the main diagnostic was not included.
* No actual message/text of an ExplainingStepItem ended up in the
tooltip.
* Copy file path for FilePathItem
* Copy location and text for ExplainingStepItem
Change-Id: I47b890f77f5ff680ce82a75b51b598681a481385
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
...by providing an icon and a text describing what will be done.
Change-Id: I923c4d593314c903adcbd831028fef5e69d28783
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
* Introduce the file path as a top level node.
* Remove the location column.
* Encode the line/column information in the DisplayRole, as for the
Clang Code Model tooltips.
* Double click on a diagnostic opens the editor.
Change-Id: I4c263537cc04c3c4feb6ccd5c395d60d8bee0bc3
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
* Remove the artificial numbering
* Use a nicer icon for notes as we mostly get these
Change-Id: Ic1022e3e2eec8512a1e80638d092c8be886aa6da
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Two areas are touched:
1. Select multiple diagnostics if they have the same set
of fix-its.
2. Watch the files and invalidate diagnostics if corresponding
file was edited.
Change-Id: If4487ba91f45c25d1aed1a98990dd9b6df9d7fe2
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
The user does not usually need the whole command line.
Task-number: QTCREATORBUG-20707
Change-Id: I30cd395cd85eb0a3dd19b9d5f1b34a1c7a4b95a5
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Make possible to select or deselect all fix-its.
Change-Id: I2ff88afb0c451092752ee2cd7c9f083e24033500
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
...if new items are added to the model or if filter is used.
When items were added, we have called
ClangToolsDiagnosticModel::diagnostics() two times:
* from DiagnosticFilterModel::filterAcceptsRow()
* from ClangTidyClazyTool::handleStateUpdate()
However, this does not scale since diagnostics() creates a temporary.
Fix this by accessing the diagnostics or the count directly from the
tree.
Change-Id: I4c6a32e0076c1b4228ed1b1ff9222c9918f92c5c
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
If a file had multiple fixits and only a subset was applied, the
remaining fixits in that file were invalidated. Fix this by adjusting
the locations of the not yet applied fixits.
Change-Id: I2c190412e871e9011c4d4a62ed938e76ad4cdf72
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Also, show the diagnostic text in the tooltip because the text might be
elided in the view now.
Change-Id: I7f38acacf72d68d7e4b696a01c7a0d1a76b4ed98
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
...in the fixit column to avoid confusion.
As a side effect, add some error handling.
Change-Id: Ia30e9c9782f3c8021aedd2be7c682853a26d3f39
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
"Apply Fixits" is disabled by default and enabled as soon as some fixits
are checked by the user.
Change-Id: I7e1345512b206f52d1e8628705c81c6b34dfb9ba
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Add a new column to the view that allows to check diagnostics with
fixits. The checked fixits can then be applied with the also new "Apply
Fixits" button in the toolbar.
Some corner cases are not yet handled:
* File is open in editor
* File changed in the mean time
Change-Id: I3d3f353a4150699a0d082f2a4348e331a4213bcf
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
...to some more generic names since they are not anymore specific to the
clang static analyzer.
* ClangStaticAnalyzerDiagnosticView --> DiagnosticView
* ClangStaticAnalyzerDiagnosticFilterModel --> DiagnosticFilterModel
* ClangStaticAnalyzerPreconfiguredSesssionTest -->
PreconfiguredSessionTests
* clangstaticanalyzerprojectsettingswidget.* -->
clangtoolsdiagnosticwidget.*
Change-Id: Ifd34f207d31dc24d6a97654aca76ff27b5025547
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
... over the whole project.
Generate and read serialized files to get diagnostics.
Change-Id: Iafc25fc70443107a040a995efc038aed35102bbf
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
To reuse it for other clang-based tools.
Change-Id: I6c0d8e9eee543fa08faf3bf93c9fac33e43c6820
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>