Commit Graph

43 Commits

Author SHA1 Message Date
Christian Kandeler
ecafdb7543 ClangCodeModel: Add experimental clangd support
If the user has enabled clangd (default is off), we start up one instance
per project when it is opened/changed (including build config switches),
and trigger background indexing.
So far, the index is used to provide results for locators and "Find
Usages".
Per-document functionality such as semantic highlighting and completion
is still provided by libclang.

Change-Id: I12532fca1b9c6278baab560e7238cba6189cde9f
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-04-22 07:32:58 +00:00
hjk
430a33dcd9 Core/Utils: Migrate further to Utils::Id
The coreplugin/id.h header is kept for downstream for now.

Change-Id: I8c44590f7b988b3770ecdc177c40783e12353e66
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-07-06 06:07:13 +00:00
hjk
36f23df6c3 CppTools: Use unshared object for CppCodeModelSettings
There's nothing shared here, only ever one copy. Ideally, this
should be const outside CppToolsPlugin, but some settings
are modified directly.

Change-Id: I775b9151a244b3cc44d28bc992a041c42d234a18
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-02-04 07:55:01 +00:00
hjk
57c41edf54 CppTools: Apply new SettingsPage patterns
Change-Id: Id7410041d5813dc3df9aeb650074f961e394cd2d
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-01-17 14:47:00 +00:00
hjk
d43b793dd8 Core: Introduce a IOptionsPage::setCategoryIconPath
Less noise on the user side.

Change-Id: I34dea09e8a3c8639f5a7db89b22f8b825b946395
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-01-16 09:53:45 +00:00
Nikolai Kosjar
0d7a30cdfe ClangTools: Query the tools for supported checks
...instead of hardcoding them for a particular version of
clang-tidy/clazy.

While at it, move also the tidy/clazy widgets to ClangTools as this
simplifies feeding data to them.

Reduce also the built-in configs to a single one using clang-tidy's and
clazy's default checks as they look very reasonable and saves us some
porting effort. Also, our previous built-in configs were just too
numerous.

Change-Id: Ib9297acb7810a940b86a23a8695530506a570394
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2019-12-03 13:23:13 +00:00
Nikolai Kosjar
3090e744c2 ClangTools: Polish ClangDiagnosticConfigsWidget
* Improve distinction between built-in and custom configs by introducing
  corresponding parent nodes
* Add button to rename a config
* Make closing the dialog apply the selected config.
* Adapt also the related ClangDiagnosticConfigsSelectionWidget showing a
  combo box of the diagnostic configs and a "Manage..." button: Remove
  the combo box and show the current config as the button text.

Change-Id: Ic015df37f2532f84bd7da6cd20bfce07799a97b8
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2019-12-03 13:22:28 +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
Eike Ziller
545552cc13 QtSupport: Remove dependency on CppTools
It was only left for the C++ category for the Qt class generation
settings.

Change-Id: I22d3f198f7b825c4a36d08d4ee28091b9e5b1f43
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-09-12 06:37:55 +00:00
hjk
e9d8ff21b0 Remove unused QObject parent arguments on options pages
In the new plugin setup scheme they are data members of the
plugin pimpl and never use the parent.

Change-Id: I28fe150393e8159064dcfbd113ce0320af50fd58
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-09-11 06:03:40 +00:00
Nikolai Kosjar
ae0d895d96 Clang: Warn of potentially expensive checks
...for the code model.

If a diagnostic configuration with potentially expensive checks is
selected in Options/Preferences > C++ > Code Model, show a warning below
the combo box.

Change-Id: I52c5c2e229fd50c0fd82f70154fb5b727726ba31
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-01-14 14:10:06 +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
Alessandro Portale
4317e350f5 Update Options dialog icons
A new set of scalable and themable icons with unified look as provided
by Diana.

Task-number: QTCREATORBUG-20325
Change-Id: I68498b034e9e43fbb61511a38d9c7fc0003ab076
Reviewed-by: hjk <hjk@qt.io>
2018-04-24 14:43:35 +00:00
Eike Ziller
d1ec4c1204 Clean up options page category display name and icon set up
In cases where plugins extend an existing settings category of a plugin
that they depend on anyhow, they do not need to specify the translated
display name and icon for that category.
Some options pages were already not setting the icon, but still the
translated name, which makes even less sense.
Clean up this mess, only setting display name and icon if that is
necessary.

Change-Id: I8bc9d0c51b11d48f1d847337838704d663e70b45
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2018-04-23 11:12:26 +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
Ivan Donchevskii
8afa7a64cc Clang: Plugins: Put settings into the TabWidget
Make tidy/clazy switch more intuitive.

Change-Id: I13d17376bdace039ae371693e28f6fcb0b493244
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2017-12-07 13:36:51 +00:00
Christian Stenger
2ab27c0842 CppTools: Fix compile with Qt5.6 and gcc4.9
Change-Id: I47668b784106c78444869595143ec8aff6928e8f
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-11-22 13:55:59 +00:00
Ivan Donchevskii
63ea3ac004 Clang: Improve code model plugins settings UI
Describe clazy levels, improve layouts.

Change-Id: I4895682ea7d10ea910c2d53725073c9c870bb306
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-11-22 13:33:54 +00:00
Ivan Donchevskii
8eececaa96 Clang: add clang plugins checks to code model settings
Add UI controls to change settings and apply them
together with warnings and command line options.
Current settings are not very flexible but should be
easy to test and use without reading tidy/clazy help.

Change-Id: I1ca6b49a42a1169b34a703dd50de0bbc105df28f
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-11-16 11:05:21 +00:00
Nikolai Kosjar
e4e6572661 CppTools: Allow interpreting ambiguous headers as C headers
...instead of C++ headers.

For the Clang Code Model this results in using "-x c-header" instead of
"-x c++-header".

This introduces a new option in Options > C++ > "Code Model" to
configure this.

Change-Id: I8a0ce8fa6155f5ef58743ebc7f1d0b500fbf6599
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2017-01-16 10:17:50 +00:00
Alessandro Portale
e809594fae Core: Make IOptionsPage::categoryIcon a Utils::Icon
This is necessary for themable + HighDPI icons in the options dialog.

Change-Id: I8e3ff87a24591af40bb76b39cd970443d7678fae
Reviewed-by: hjk <hjk@qt.io>
2016-09-20 12:52:49 +00:00
Nikolai Kosjar
83ea1f4deb CppTools: Add UI for file size limit of indexer
Task-number: QTCREATORBUG-16712
Change-Id: I92db8cbcac9669cbd5e4ee5f7ef6f613797c753a
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2016-08-31 07:47:27 +00:00
Nikolai Kosjar
62fe8fcef0 Clang: Clarify when clang code model is enabled
Change-Id: I07cf53641ea4f9ddb7ca7a67977b1ad7d43c5bad
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-07-19 07:26:16 +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
Tobias Hunger
397e7f4843 Update License according to agreement with Free Qt Foundation
* Update files in src/plugins

Change-Id: Ia5d77fad7d19d4bb3498e78661982f68729adb22
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-01-19 15:57:01 +00:00
Nikolai Kosjar
f89d3dca8b Clang: Activate code model automatically if plugin is loaded
This removes also the need to close editor documents.

Change-Id: I96c68105bceb37841053f3dbd8a264e059a02cb8
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
2015-12-16 12:23:58 +00:00
Nikolai Kosjar
439db76f64 CppTools: Clean up CppCodeModelSettingsWidget
Change-Id: Iee93d2d656a8a5c991b292d3e591cedd3e86f9e3
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
2015-11-16 14:18:30 +00:00
Nikolai Kosjar
48952084a6 Clang: Remove per-mimetype settings
Related to

    commit c47079f97f7d42db0c581525a2ce6fddbc0995f2
    Clang: Activate the code model with a check box

Change-Id: Ief11768ba0dd27788032e2dd3ad9b7ae39a8f52b
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
2015-11-16 14:08:25 +00:00
Nikolai Kosjar
d8f119c8a2 Clang: Allow to provide extra command line options
This can be used to experiment with clang options that e.g. affect
diagnostics.

Changes take effect on editor re-open.

Change-Id: Ie46d0ff085a3700a748dbcf4b94b93b0bf9c4642
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2015-11-11 15:14:56 +00:00
Nikolai Kosjar
72785e3a11 Clang: Activate the code model with a check box
If the plugin is not activated, show a hint.

The underlying settings are still mime type based. This will be
addressed in a follow-up change.

Change-Id: I24b232365d505a0022a78e96eb496d219a8b7c5b
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
2015-11-11 15:12:19 +00:00
Nikolai Kosjar
23b8a3b2e8 Clang: Use completion through backend process
This makes us independent of libclang crashes for completion.
Re-parsing for highlighting still happens in the Qt Creator process.

Run in verbose mode:
    qtc.clangcodemodel.ipc=true

Run tests:
    -test "ClangCodeModel"

Task-number: QTCREATORBUG-14108
Task-number: QTCREATORBUG-12819
Change-Id: Id3e95bd2afdb6508bbd1d35fddc69534a909b905
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
2015-06-10 10:15:40 +00:00
Eike Ziller
3c85058694 Update License
Change-Id: I711d5fb475ef814a1dc9d2822740e827f3f67125
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
2015-01-16 12:37:56 +01:00
Eike Ziller
8295b503be License update
Change-Id: I3c22ef2685d7aa589f5d0ab74d693653a4c32082
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
2014-10-09 11:41:44 +02:00
Nikita Baryshnikov
12103e0f67 Reinvent deprecated qSort as Utils::sort
Change-Id: I4f6011cc2b6127037249aabc2426a88ad7108ebf
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
Reviewed-by: hjk <hjk121@nokiamail.com>
2014-06-19 14:00:32 +02:00
Eike Ziller
236ea9efb9 Merge remote-tracking branch 'origin/3.0'
Conflicts:
	share/qtcreator/debugger/dumper.cpp
	share/qtcreator/debugger/dumper_p.h
	share/qtcreator/debugger/test/main.cpp
	src/plugins/debugger/gdb/classicgdbengine.cpp
	src/plugins/debugger/gdb/pythongdbengine.cpp
	src/plugins/debugger/lldblib/guest/lldbengineguest.cpp
	src/plugins/debugger/lldblib/guest/lldbengineguest.h
	src/plugins/debugger/lldblib/guest/main.cpp
	src/plugins/debugger/lldblib/ipcengineguest.cpp
	src/plugins/debugger/lldblib/ipcengineguest.h
	src/plugins/debugger/lldblib/ipcenginehost.cpp
	src/plugins/debugger/lldblib/ipcenginehost.h
	src/plugins/debugger/lldblib/lldbenginehost.cpp
	src/plugins/debugger/lldblib/lldboptionspage.cpp
	src/plugins/qbsprojectmanager/qbsstep.cpp
	src/plugins/qbsprojectmanager/qbsstep.h
	src/plugins/qmlprofiler/canvas/qdeclarativecanvas.cpp
	src/plugins/qmlprofiler/canvas/qdeclarativecanvas_p.h
	src/plugins/qmlprofiler/canvas/qdeclarativecontext2d.cpp
	src/plugins/qmlprofiler/canvas/qdeclarativecontext2d_p.h
	src/plugins/qmlprofiler/canvas/qmlprofilercanvas.cpp
	src/plugins/qnx/blackberrycheckdevmodestep.cpp
	src/plugins/qtsupport/debugginghelper.cpp

Change-Id: Ie9fd0a885fb6264a6a8a72daee071b75bcbd2e9d
2014-01-08 11:01:06 +01:00
Robert Loehning
746c5d8863 Incremented year in copyright info
Change-Id: Ib5423fdd064e4546f848c0b640b0ed0514c26d3a
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2014-01-08 08:29:47 +01:00
Erik Verbruggen
18ac68adb3 C++: add header chooser to codemodel settings page.
Change-Id: I2da9c4b382afcad2faad1817af266381a2f02b2a
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2014-01-07 09:29:20 +01:00
Erik Verbruggen
5beb74fd9d Add experimental clang code-model plug-in.
Previously known as the wip/clang branch.

Contributors (in alphabetical order):
- Christian Kamm <christian.d.kamm@nokia.com>
- Erik Verbruggen <erik.verbruggen@digia.com>
- Leandro Melo <leandro.melo@nokia.com>
- Peter Kuemmel <syntheticpp@gmx.net>
- Sergey Shambir <sergey.shambir.auto@gmail.com>

Change-Id: I4c3ff600a19b6732641c1d5ef28236bf2cc17737
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-12-20 17:05:09 +01:00
Eike Ziller
deb43b4c8a Preferences: Add default implementation for filtering
The default "matches" method now takes the widget and looks for all
child labels, checkboxes, push buttons and group boxes.
Because of that, the former "createWidget" method
can be called multiple times without creating a new widget
(-->widget()), and the "finished" method must ensure that the created
widget gets deleted, since not all widgets that were created are added
to the UI anymore.

Change-Id: Ia231c7c78dd8819146668e6447d36d22e7836904
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2013-12-10 13:31:48 +01:00
Erik Verbruggen
507452f097 CppTools: honor pre-compiled headers in the code-model.
Task-number: QTCREATORBUG-476

Change-Id: I82ed92acdcda551d2c6a9ca221832ac20117a08f
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-10-01 13:02:45 +02:00
Erik Verbruggen
c9f5a14bdd C++: add code-model settings to choose one by mime-type.
The model-manager now supports multiple code models for semantic
highlighting and code completion, and will choose one based on the
mime-type of the editor.

The settings page is currently disabled. It will get enabled when a
second plug-in lands that has a ModelManagerSupport class.

Change-Id: I10023f52322ed6860397da15dba1c231e80e6517
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-09-13 14:37:48 +02:00