Commit Graph

19 Commits

Author SHA1 Message Date
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
b9d3055e72 Clang: Allow to forward warnings flags from build system
Change-Id: I47ebb1ce4f3b5544408eb1d0f891ed5090394282
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2019-02-05 11:36:55 +00:00
Nikolai Kosjar
7315d9a47c Clang: Make clazy UI more fine-grained
...so that specific checks can be enabled/disabled.

This replaces the level radio buttons in Tools > Options > C++ > Code
Model > "Manage..." > Tab: Clazy.

Task-number: QTCREATORBUG-21120
Change-Id: If468d79d3c309b287b4105d83ac31f0b1489c71c
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2019-01-24 07:39:07 +00:00
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
Ivan Donchevskii
bc458c7b5f Clang: Use the tree instead of the list for Clang-Tidy settings
List of checks does not give enough flexibility to
select/unselect specific checks. The tree fixes that.

Also remove Clang-Tidy checks line edit because it is
now integrated into the tree mode as an alternative way
of providing checks by pressing "Plain text edit" button.

'cpptools_clangtidychecks.h' is generated using python
script 'generateClangTidyChecks.py' and clang-tidy
from our LLVM/Clang 6.0 build.

Change-Id: I2ed1738cb2cbbf8dac6aba563469f06f69b11593
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2018-05-25 09:59:20 +00:00
Nikolai Kosjar
90d377bee9 ClangTools: Preselect current diagnostic config
...in ClangDiagnosticConfigsWidget when clicking on the "Manage..."
button. This allows to inspect the current diagnostic configuration
without further interaction steps.

Change-Id: I732445b33f4f194c9b9b60e184d970420ab55ec8
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-05-23 10:48:14 +00:00
Ivan Donchevskii
53d7906061 CppTools: Merge diagnostic selection widgets together
QComboBox, QLabel and QPushButton are always used
together. Therefore it makes sense to put them in one
custom widget.

Change-Id: Ie21675530fbadd7071f2a362567dadb6f09bb68d
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2018-05-14 09:05:37 +00:00
Ivan Donchevskii
3737b6a124 CppTools: Split diagnostic settings and selection
Now selection is only consists of combobox and
a "Manage" button to diagnostic configurations.
Diagnostic configurations are moved to the modal dialog
which is shown by clicking the mentioned "Manage" button.

Change-Id: I607fb923c97e8730448548708f3aaf32ce1983c8
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2018-05-14 07:02:53 +00:00
Tobias Hunger
b554c761fb CppTools: Consistently use nullptr
Fixed by clang-tidy modernize-use-nullptr.

Change-Id: I951627ba3543faa357f67ee76527518290efe3f1
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-05-09 12:15:01 +00:00
Tobias Hunger
91c19ab19d CppTools: Use override consistently
clang-tidy fixes from modernize-use-override check.

Change-Id: I0e6d6a9df3e87b8042ccc5ea0adc70070a3821d6
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-05-07 13:38:20 +00:00
Ivan Donchevskii
4d153b4f67 Clang: Add combobox with tidy configuration options
The old way was not flexible enough.
With these options it's possible to just use your
config file or set tidy command line yourself.

Change-Id: I1bace40986668dee5e1b30c9d03090a3fd22e253
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2018-03-19 13:19:00 +00:00
Nikolai Kosjar
2cedb0531c CppTools: Use radio buttons for clazy options
Change-Id: I7c307cffce58c8dc4fd00d17b5c477c85ba509d8
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-02-08 14:46:05 +00:00
Nikolai Kosjar
8cd96c2142 CppTools: Improve clang diagnostic configuration UI
...by clarifying the widget hierarchy. Ensure that the combo box at the
top is perceived as the main widget:

* Remove the "Configuration to use:" label so the combo box gets more
  horizontal space and thus dominance. Also, rename the group box
  header/label from "Clang Diagnostic Warnigns" to "Clang Diagnostic
  Configuration".
* Move the command line text edit below the combo box into its own tab
  page to clarify the relation to the tidy/clazy tabs.

Change-Id: I97a0785678e33b94746046d07a911422b1469890
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-02-08 14:45:59 +00:00
Nikolai Kosjar
33b6fe812a Clang: Make clazy/tidy options part of the diagnostic config
As a side effect, clazy/tidy options become available for project
specific customization in the projects mode.

Change-Id: Id72762dedd857915139c15f532d2f1c6d1f43edb
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-01-29 08:14:14 +00:00
Nikolai Kosjar
082ba1d133 Clang: Validate warnings options from user
...in "Menu: Tools > C++ > Tab: Code Model > Clang Code Model Warnings"
to avoid (re)parse issues due an invalid command line for libclang.

If an invalid option is detected, then indicate it by providing an error
message. As long as there is an invalid option, the options are not
accepted.

We do not want to maintain a white list of valid options, so mostly
check whether the option starts with "-W". An unknown or misspelled
option like "-WnotYetKnown" will be ignored by libclang.

To keep passing in some options for testing/debugging convenient, skip
validation if QTC_CLANG_NO_DIAGNOSTIC_CHECK is set.

Task-number: QTCREATORBUG-18864
Change-Id: I196d0474c7521969c54133f52dfc7be0394bfc3e
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-09-19 06:57:11 +00:00
Ivan Donchevskii
78db7d7ed2 Clang: turn off delayed template parsing
Fix templates highlight and completion on Windows
Add UI to turn on/off delayed parsing (off by default)

Task-number: QTCREATORBUG-17222
Change-Id: I0cd5e0bcfff2789cd938e4096829f777ff15957a
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-06-08 10:53:31 +00:00
Orgad Shaneh
46cacd901a CppTools: Use Qt5-style connects
Mostly done by clazy.

Change-Id: I0fbbbe1a2d28b79bcb83093d608bca6e2f927ebb
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2016-05-23 09:02:21 +00:00
Nikolai Kosjar
83e18c127c Clang: Introduce warning configuration per project
Change-Id: I5b9a330274e6f72b0786259eb25aa454877d4eef
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
2016-03-01 15:55:30 +00:00
Nikolai Kosjar
8cfef9657a Clang: Introduce switching/adding of warning configurations
A warning configuration is a list of command line (warning) options for
libclang. Three non-editable built-in configurations are provided by
default. The user can copy a configuration to customize it.

This is still a global setting and it changes take effect after
re-opening a document. Both issues will be addressed in follow-up
changes.

Change-Id: I86667d7dc39ad31b88666454220e6da563797740
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
2016-03-01 11:21:36 +00:00