Commit Graph

19 Commits

Author SHA1 Message Date
Nikolai Kosjar
4d09e77719 ClangTools: Move checkbox from view's header to toolbar
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>
2019-12-03 13:23:58 +00:00
Nikolai Kosjar
0112305b06 ClangTools: Polish toolbar
Change-Id: I1df7cb4969a8aa4676bfe03af5c69572eb7aa73a
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2019-11-29 09:31:10 +00:00
Nikolai Kosjar
b2f5ed78e1 ClangTools: Add "go to project settings" toolbar button
With the introduction of the "Analyze Current File" action the widget to
configure the diagnostic config was moved to the project panel (Project
mode > Project Settings > Clang Tools).

As not too many users are aware of the project settings there and
navigating there involves more user interation now (mode switch, looking
for the "Clang Tools" item), add a toolbar button as a shortcut.

Change-Id: I4c864045ef41ff501d925d3175ce604def213f29
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-11-27 14:42:12 +00:00
Nikolai Kosjar
fdd3262cab ClangTools: Fix state of the "Apply Fixits" button
* 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>
2019-10-31 14:07:38 +00:00
Nikolai Kosjar
a0a39a0470 ClangTools: Make file selection dialog searchable/filterable
Allow filtering for open and edited documents.
Add also search functionality (triggerable by e.g. Ctrl+F).

Change-Id: Ib41400abfd3b81371afddd56b88ff1b9bf8b9bcd
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-10-01 14:42:01 +00:00
Nikolai Kosjar
b895dfa382 Clang/ClangTools: Separate custom diagnostic configs
Add a separate pool of custom diagnostic configs for the
ClangTools plugin. That is, the diagnostic configs in

  Menu: Tools > C++ > Code Model

are not shared anymore with the configs at

  Menu: Tools > Analyzer > ClangTools

On plugin initialization of ClangTools, move tidy/clazy related configs
to ClangTools.

Change-Id: Id06087a58b53e466a3d7bbac669550c5fbe9899d
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-10-01 14:10:28 +00:00
Nikolai Kosjar
d2648db914 ClangTools: Clean up plugin tests
We can provide the run settings explicitly instead of writing to the
settings.

Change-Id: Ibb9ef0280c14315ff7ba72be75dfd04c50d84484
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-10-01 13:51:42 +00:00
Nikolai Kosjar
d5bae3c1eb ClangTools: Merge ClangTidyClazyTool into ClangTool
Change-Id: Ieb6c4994ddcff9339a9cfb25c82e23dd2d2e8912
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-09-27 11:56:42 +00:00
Nikolai Kosjar
04f9c41432 ClangTools: Add action for running on current file
Ideally, we would build the particular file before running the analyzer,
but not every project manager supports that.

For now, skip building the project for this action.

Change-Id: Ibc516c41dd0dbeb7b17b44c0ac35ae4b46ae801d
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-09-12 13:35:43 +00:00
Nikolai Kosjar
f240a9a947 ClangTools: Add using for QList<Diagnostics>
Change-Id: Ie7978fc33386d083b786ad75b3b6700125b11fec
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-07-25 12:18:49 +00:00
hjk
473a741c9f Utils: Rename FileName to FilePath
More in line with QFileInfo terminonlogy which appears to be
best-of-breed within Qt.

Change-Id: I1d051ff1c8363ebd4ee56376451df45216c4c9ab
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-05-28 12:23:26 +00:00
Nikolai Kosjar
45fd5a3f9e ClangTools: Fix plugin tests
The tests expected diagnostics from source files only, but provided also
the ones from the header.

FAIL!  : ClangTools::Internal::ClangToolsUnitTests::testProject(qt-widgets-app.qbs) Compared values are not the same
   Actual   (tool->diagnostics().count()): 4
   Expected (expectedDiagCount)          : 1
   Loc: [/d1/creator/4.9/source/src/plugins/clangtools/clangtoolsunittests.cpp(133)]
FAIL!  : ClangTools::Internal::ClangToolsUnitTests::testProject(qt-widgets-app.pro) Compared values are not the same
   Actual   (tool->diagnostics().count()): 4
   Expected (expectedDiagCount)          : 1
   Loc: [/d1/creator/4.9/source/src/plugins/clangtools/clangtoolsunittests.cpp(133)]

Change-Id: I9270ba8cb554af3a3254e21d55656e73bcae71dd
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2019-02-12 09:32:31 +00:00
Nikolai Kosjar
46fc8c4144 ClangTools: Show also diagnostics from project's header files
Fixes: QTCREATORBUG-21452
Change-Id: I73c85224e142f4f1d08c9ada75fe8359ebf0f984
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2019-01-25 14:32:01 +00:00
Nikolai Kosjar
820e4f8177 ClangTools/QMake: Stop analyzing files not part of build configuration
...for the qmake project manager.

When parsing the project files, remember whether a file was discovered
by the exact or cumulative parse. Only files that were discovered by the
exact parse are considered "active" and thus part of the build
configuration. The others are not offered for selection.

Fixes: QTCREATORBUG-16016
Started-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Change-Id: I7a28b4de15e048975d7f0cd737dd8c11f744315b
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-01-08 14:09:52 +00:00
hjk
e9eb1a6437 Debugger/Perspectives: Go back to QPointer<QObject>
Lifetime of the pointed-to object may end before that of
the plugin, so unique_ptr is the wrong choice.

This amends 01f2b982a2.

Change-Id: I76b9ac78348d2ae1e7eff0693b091dbe8475ab93
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-08-02 08:56:20 +00:00
hjk
01f2b982a2 Debugger: Move ownership of perspective dock widgets to plugins
Similar to the previous patch, but affecting more plugins: with dynamic
perspectives lifetime is better managed close to the code that knows how
to (re-)construct the items.

Change-Id: I0e7bfcf769d198ec2afa88b972be900baa1b6a46
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-08-01 11:27:21 +00:00
Ivan Donchevskii
be3e848c0f Clang: Don't analyze same file multiple times
Diagnostics do not depend much on project parts. But
having the same file twice can result in duplicated
diagnostics which later can cause the same fix-it
being applied twice and getting corrupted code.

Change-Id: Ie2809af7a54034b05df9383875f7c3123aea58e8
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-06-28 12:50:34 +00:00
Nikolai Kosjar
1bc605d050 ClangTools: Prompt for files to analyze
If the run button is clicked, the user is prompted to select the files
for analysis.

Change-Id: I21e4ee6b7c14392a8c1a901ac7aa1c9c16e30f0d
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-05-11 10:48:53 +00:00
Ivan Donchevskii
e9c462391e ClangTools: Split generic part from static analyzer tool
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>
2018-04-13 12:34:53 +00:00