Commit Graph

2507 Commits

Author SHA1 Message Date
Eike Ziller
4faefe7343 CppHoverHandler: Remove unused function
Change-Id: I76aad25e16424e0d0dad16732b7562a90819c407
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-01-28 09:50:11 +00:00
Eike Ziller
dabeb0aa1e Move Help item from text editor to core
The functionality is not text editor specific.

Change-Id: Iee531572f14673e75129f4bfbb64a1437899d31e
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-01-25 09:46:21 +00:00
Nikolai Kosjar
65b0b99988 Clang: Fix return type
Change-Id: I6d97968c2aebe74c84cbd6cb56dfbbc743b0753d
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-01-25 09:33:08 +00:00
David Schulz
7b7a2ad630 TextEditor: Use callback in refactoring markers
Allows to trigger actions without adding specific handling into the
editor.

Change-Id: Ia63d65d3feca37bcefca1b6322ade039027a92d8
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-01-25 06:13:11 +00:00
Ivan Donchevskii
6fa088589b Clang: Fix parsing files with Android toolchain
- filter out include paths from command line flags
 - do not search for MinGW parent toolchain in Android toolchain

Change-Id: I5f2566aa0bd10eb939380193e64e17b000743b73
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-01-24 13:12:41 +00:00
Nikolai Kosjar
b5f7e303ee Clang: Fix build with GCC 5.3
Change-Id: I066c1c076c900e4eb3282e64b0b928327d15484d
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-01-24 12:24:46 +00:00
Marco Bubke
f5c3007058 CppTools: Add sourceFilePath to AbstractEditorSupport
Provide the source path to track a generated file source. You can for
example get the modified time stamp for the source file and use it for the
generated file content.

Task-number: QTCREATORBUG-21876
Change-Id: Ia422e128c5cb7a3dce88960f126152c2f65afb41
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-01-24 10:03:45 +00:00
Ivan Donchevskii
2e19352177 ClangFormat: Fix applying global settings
The actual apply() method was never called for the widget.

Change-Id: Idff194a36591db437cbe5695377005ed5a0b25d4
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-01-24 08:36:05 +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
093673e9cf Clang: Fix how tweaked header paths work
We need to provide built-in includes only when we use tweaked headers.
Also let's require Clang resource directory because it has to be
placed on the specific position inside the built-in header paths.

Change-Id: Id581238660c680725201de759216cf33f69f6cc7
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-01-23 12:04:40 +00:00
Filip Bucek
aaa8beab88 Wizards: Support using #pragma once instead of include guards
Allow users to choose #pragma once instead of #ifndef include guards in
generated header files.

Fixes: QTCREATORBUG-12166
Change-Id: I3ba41c7570beb9c5958e174b5581fcc25855050f
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Filip Bucek <fbucek@atlas.cz>
2019-01-23 09:10:42 +00:00
Ivan Donchevskii
7f9931b3f9 Fix MSVC2015 build
- error C3431: 'LanguageExtension': a scoped enumeration cannot be
redeclared as an unscoped enumeration

 - add constructors to SlotUsage

 - do not use pointers for back_insert_iterator.

Change-Id: Id6df08436de639b70fdf6ccc4914f8dee2cb8628
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2019-01-22 12:57:08 +00:00
Ivan Donchevskii
d7058e1afe ClangFormat: Refactor indenter to allow ClangFormat unit-tests
We do not build texteditor files in unit-tests so some tricks
were required to make ClangFormatIndenter available.

First simple unit-test proofs it builds and runs.

Change-Id: I81d5ea099bd27fd1c1ed8b5b7877299dcc62a67f
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-01-22 09:52:15 +00:00
Marco Bubke
dd366b68de PchManager: Split pch tasks in project and system pch tasks
Like you can see in the task numbers this patch is touching many different
areas. So I will only touch the main parts. It is using a clang action
instead of an extra process which will be enabling the handling of
generated files in PCHs. The flags from the project part are now not
anymore transformed in a command line but they are saved in the container
semantically aware so that they can later be merged. Most of this patch is
simply polishing of other patches.

Task-number: QTCREATORBUG-21346
Task-number: QTCREATORBUG-21380
Task-number: QTCREATORBUG-21382
Task-number: QTCREATORBUG-21383
Task-number: QTCREATORBUG-21693
Task-number: QTCREATORBUG-21778
Change-Id: I9b0c02d8149b554254e819448fbc61eeaa5b7494
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2019-01-21 15:27:10 +00:00
Tim Jenssen
a78e3e5dd5 use initializer lists
Change-Id: I82b04601f1db52197b3dc625b6b7e0f143c1c8b6
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2019-01-21 15:10:54 +00:00
Orgad Shaneh
ba558143c2 CppTools: Fix GCC8 warning
cppcodemodelinspectordumper.cpp:669:97: warning: type qualifiers ignored on cast result type [-Wignored-qualifiers]

Change-Id: Ie991ca958ca3f09c31bfe88c922a314a3b8d5677
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-01-21 13:06:14 +00:00
Eike Ziller
6c10d36f87 Try harder to get context help in presence of diagnostics
- even if there are diagnostics still try to retrieve symbol info
  and help
- fall back to text based keyword extraction in case code model
  info fails
- if both a code model tool tip (e.g. function signature or type)
  and help are available, show both

Task-number: QTCREATORBUG-15959
Change-Id: Id85a223c24849ead1b25d63776d64a7da1cc73ef
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-01-21 10:30:03 +00:00
Ivan Donchevskii
2d8bc0e509 Clang: Do not QTC_ASSERT when file kind is not set
We do not set file kind when building an initial command line for
libclang and this assert triggers all the time.

Change-Id: If607cf68ca5bcd788abe77875787bed24db57573
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-01-21 09:18:13 +00:00
Alessandro Portale
1d3d18a969 CppTools: modernize
Change-Id: Iaf02e4d026f1ac8b216833d83cd7a735e21ff60a
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2019-01-21 09:00:18 +00:00
Nikolai Kosjar
eb9e8e128b CppTools: Fix incorrect QTC_ASSERT
Change-Id: I1c7bd599cc121484b4d33723123f34981c675407
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2019-01-17 10:55:43 +00:00
Alessandro Portale
c82d2cbd54 Fix warning: "Don't call QList::last() on temporary"
[-Wclazy-detaching-temporary]

Change-Id: I5e06e44fc45c80ea1dca518611d4f0c28a738061
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2019-01-17 10:05:30 +00:00
Alessandro Portale
adea8467f4 Fix warning: "Don't call QHash::operator[]() on temporary"
[-Wclazy-detaching-temporary]

Change-Id: Ide503c9260af285fa1dbedb63f7819c8ad616db6
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2019-01-17 10:04:11 +00:00
Ivan Donchevskii
0679c2ff25 Clang: Never use toolchain defines
The known cases provide enough flags not to require
toolchain defines.

Change-Id: Ia7e08a90eca6ea9474db40683ac1e63236f8643d
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-01-16 12:18:55 +00:00
Ivan Donchevskii
0348009e0e Clang: Support MSVC style of compiler flags
Clang has MSVC compatible mode which works with MSVC style command line
flags.

When possible use the same flags (-I, -D, -U, etc.) and in other cases
either replace by MSVC analog (for example use /FI instead of -include)
or pass the argument with '/clang:' prefix (requires
https://reviews.llvm.org/D53457).

Change-Id: I95f33bed5dc8d9493895ed8d4359cdd70fc774b8
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-01-16 12:17:31 +00:00
Nikolai Kosjar
4c0c3f5a64 Clang: Forward compiler options for gcc/clang
Rely on clang to do the "right thing" with them.

Change-Id: I44adf2cd5c61549896da3fc9b7c35c2fb0142060
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2019-01-16 11:47:29 +00:00
Christian Stenger
3bcd0c8d81 CppTools: Fix build for MSVC2015
Change-Id: I9bb230b73051330333109b3dd521feceb1ee94a7
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2019-01-15 14:38:05 +00:00
Marco Bubke
5dbaf387ba Utils: Move C++ language details from ProjectExplorer to Utils
We want to use them in the backend processes too so it's nice to share them
in Utils. A concrete size was added too because they should be serialized.

Change-Id: Id5eb8f46643d5159f034fc9559f68a08d7e5847a
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-01-15 10:37:03 +00:00
Eike Ziller
71d60ee9c8 Merge remote-tracking branch 'origin/4.8'
Conflicts:
	src/plugins/cpptools/compileroptionsbuilder.cpp

Change-Id: I522f91de70aff28692d7c3a050e8d52df0b82a76
2019-01-15 08:40:23 +01: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
951aee8f3a Clang: Fix parsing boost headers
The fix for MSVC2013 undefined clang macros to fix some
internal Qt stuff failing in Qt 5.7.

Now we know exactly which MSVC version is used and can
ignore this fix for newer versions.

Fixes: QTCREATORBUG-16439
Fixes: QTCREATORBUG-21685
Change-Id: Ie2844428c39d72d212198ee2dd6841420a464974
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-01-14 06:44:52 +00:00
Nikolai Kosjar
7109e8f050 Clang: Minor cleanups in CompilerOptionsBuilder
Change-Id: Iaf5af70136bceed52d19622c01d9d7147e5abeea
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2019-01-11 07:20:52 +00:00
Nikolai Kosjar
591cc5a8c4 CppTools: Reorder some (Raw)ProjectPart members
Mostly for clarity, but as a side effect, this reduces the size of
ProjectPart from 168 to 160 bytes.

Change-Id: Iee23c97d581a5233554c05ed2fd7ea07e2e9b45a
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2019-01-11 07:20:32 +00:00
Nikolai Kosjar
7b494c068e CppTools: Simplify ProjectUpdateInfo
...by using KitInfo.

Change-Id: I17b4dd6c368ba8b10b765f12a4663c041c9be7e5
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-01-10 07:13:49 +00:00
Nikolai Kosjar
4ce9ec5d63 CppTools: De-duplicate code for CppProjectUpdater
Centralize gathering the kit, toolchains and qt version.

Change-Id: I6bd586ac7925e2ee556fd119f1dab096cd500e41
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-01-10 07:13:38 +00:00
Nikolai Kosjar
b114f77d8a Clang: Stop enabling exceptions explicitly
According to commit e2e3be09e3 this was
needed for clang 3.8.0 on Windows.

Change-Id: I4f2c2bf31449d9613607e57524c7ff6e4577812a
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2019-01-09 15:03:25 +00:00
Orgad Shaneh
c225216b93 Utils: Introduce GlobalFileChangeBlocker
Tracks application state, and signals when it is changed.

Supports forcing blocked state with reference counting.

Change-Id: Ic173d42446b1b08bd4a1e7c1acf38c68644d30b3
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-01-08 14:21:39 +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
Eike Ziller
04a4bacbf9 Merge remote-tracking branch 'origin/4.8'
Conflicts:
	src/plugins/coreplugin/dialogs/externaltoolconfig.ui

Change-Id: Ie38e9028cee599578c59b22325d85c097335243e
2019-01-07 13:24:12 +01:00
Bernhard Beschow
9ee785a4ef CppModelManager: Remove method overload used only in tests
Use (and therefore test) the method actually used in production code.

Change-Id: I4317517ef8a1779df4d46af3905790012ee98645
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-01-06 21:50:08 +00:00
Bernhard Beschow
3bdb7d1de5 CppProjectUpdater: Remove unread attribute
Change-Id: I51123e5b5609de431cfa6d1558aed0b9739ff9c8
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-01-06 21:49:28 +00:00
Bernhard Beschow
552e730426 QbsProject: Remove unread attribute
Also remove the signal CppProjectUpdater::projectInfoUpdated() which is
now unused.

Change-Id: I65afe8f96cd8175edaf8ccb6e5067e4f9cd8d99f
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-01-06 21:48:42 +00:00
Christian Kandeler
3741c2213d CppTools: More build fixes
Change-Id: I350479c0f79869cccdf0edfd6c89d932d8f3215f
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2018-12-21 11:26:48 +00:00
Christian Kandeler
e250543cc7 CppTools: Fix build
Amends 97828a96af and ef8de6a384.

Change-Id: I9dd7d6a093657ea6f20ff3b5a4d0c968f8293ad7
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-12-21 08:21:53 +00:00
Marco Bubke
781dadc94a CppTools: Add reset function to CompilerOptionsBuilder
It makes it easier two get different options.

Task-number: QTCREATORBUG-21693
Change-Id: Ibcfa52d8bbbdf971a38fb6102a6b79e037a9cf02
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-12-20 18:46:44 +00:00
Marco Bubke
97828a96af CppTools: Adapt CompilerOptionsBuilder to HeaderPathFilter
After we moved some of the code to HeaderPathFilter we now use it in
CompilerOptionsBuilder.

Task-number: QTCREATORBUG-21693
Change-Id: Iea3569465bbc135d72bd88f9c23026f2ace33aba
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-12-20 18:46:14 +00:00
Eike Ziller
83fb81df35 CppTools: Fix categorization of *.inl, *.tpp, and similar
These are files that are included like headers, and not compiled
themselves, so e.g. adding them to a project should not categorize them
as source files.

Fixes: QTCREATORBUG-21736
Change-Id: I7dafba02896d12160de5eed458b99144df0a5f37
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-12-19 13:35:15 +00:00
Bernhard Beschow
763e0d059e CppProjectUpdater: Reuse cancelAndWaitForFinished()
Change-Id: I749dd0244175060ce79d6050b12b729866c06c9d
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-12-19 13:27:37 +00:00
hjk
e6a71fb43d CppTools: Compile fix
Amends ef8de6a384516c.

Change-Id: I50dc5b63867888ed258d6dedf643c3cc33b1014c
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2018-12-17 13:21:49 +00:00
Marco Bubke
ef8de6a384 CppTools: Introduce HeaderPathFilter
We went the filtering of the header path outside of the compiler options
builder so merge the PCHs.

Task-number: QTCREATORBUG-21693
Change-Id: Ia1126813a5049e39d7c6e7d60bf449aa17012d02
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-12-17 11:06:14 +00:00
Eike Ziller
9084ca73df Merge remote-tracking branch 'origin/4.8'
Conflicts:
	qbs/modules/qtc/qtc.qbs
	qtcreator.pri
	src/plugins/cpptools/compileroptionsbuilder.cpp

Change-Id: I87f47cecbb924064296a002fd9446a0627acad8e
2018-12-12 09:44:13 +01:00