Commit Graph

16 Commits

Author SHA1 Message Date
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
f6d1d5b41e CppTools: Change QComboBox in diagnostic settings to QListWidget
ComboBox gives an impression of selecting one of
the entries which is not the case for this widget.

Change-Id: I83f94def7553d4ceaec5ba957765f4494dc3d610
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2018-05-14 07:03:29 +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
Ivan Donchevskii
41a12410e6 Clang: Fix initial tidy settings tab
When no settings exist it has to be disabled.

Change-Id: I1cb8368edf182fa616930f5718323c8e03a0e649
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2018-03-27 13:54:06 +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
fc37af56ff CppTools: Disable text edit for built-in clang configs
Otherwise it looks like the options can be customized without copying
the configuration.

Change-Id: I7df26f8f2e3f566f659d12258730d2f514e9d71b
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-02-14 07:24:29 +00:00
Nikolai Kosjar
936d639403 CppTools: Provide hint to copy clang diagnostic config
If a built-in/read-only configuration is selected, show a hint that it
needs to be copied to make customizations.

Change-Id: I62fc51b7548ec7cd6a156a0be84d9dcb41849ee7
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-02-14 07:18:02 +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
Nikolai Kosjar
9cc50a96e4 Clang: Fix updating warning config widgets on remove
Problematic use case was:
 1. Go to projects mode, select "Clang Code Model"
 2. Click "Copy...", click "OK" and add e.g. " -Wbla"
 3. Click "Remove"
 ==> The configuration is reset (combobox), but the warning options are
     not (" -Wbla" is still there).

Change-Id: Ifc445a3fa0e3b3191915cf7bca220f4bef848069
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2016-04-15 12:02:28 +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