Commit Graph

1150 Commits

Author SHA1 Message Date
Christian Kandeler
284817fae6 Merge CppTools into CppEditor
There was no proper separation of responsibilities between these
plugins. In particular, CppTools had lots of editor-related
functionality, so it's not clear why it was separated out in the first
place.
In fact, for a lot of code, it seemed quite arbitrary where it was put
(just one example: switchHeaderSource() was in CppTools, wheras
switchDeclarationDefinition() was in CppEditor).
Merging the plugins will enable us to get rid of various convoluted
pseudo-abstractions that were only introduced to keep up the artificial
separation.

Change-Id: Iafc3bce625b4794f6d4aa03df6cddc7f2d26716a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-09-01 14:53:58 +00:00
Eike Ziller
0777b65db3 Merge remote-tracking branch 'origin/5.0'
Conflicts:
	qbs/modules/qtc/qtc.qbs
	src/plugins/android/androidconfigurations.cpp

Change-Id: If8dc2cdf131811e08ca147c6f58dbb3ed3bf7227
2021-08-26 11:09:08 +02:00
Christian Kandeler
e0e8fda580 ClangCodeModel: Use clangd for completion and function hint
Change-Id: I80160f3a40da18ac178682afe6caba5e5af6e3eb
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-08-23 09:06:31 +00:00
Cristian Adam
54c5322322 CppTools: Code model fix for C++20, MSVC, and newer CMake versions
Starting with version 3.20 CMake adds -std:c++20, which breaks the
code model when using MSVC.

Clang-cl 12 doesn't know about -std:c++20, but clang driver knows
about -std=c++20.

Fixes: QTCREATORBUG-26146
Change-Id: I696842e11b0a9ba8849455d2f81f8dde6dd95a27
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-08-20 15:28:57 +00:00
The Qt Project
d8a61bcea4 Merge "Merge remote-tracking branch 'origin/5.0'" 2021-08-18 14:42:50 +00:00
Jarek Kobus
6d18df6207 Remove QTC_REL_TOOLS_PATH and use RELATIVE_LIBEXEC_PATH instead
Change-Id: If737d7050985f2ae03d543c63347ea465a65c648
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-08-18 14:30:02 +00:00
Eike Ziller
94d352ab28 Merge remote-tracking branch 'origin/5.0'
Conflicts:
	src/plugins/autotest/testresultdelegate.cpp

Change-Id: If172206f231fc2a9f4a672cd2e6eaeaea4988c96
2021-08-18 16:14:24 +02:00
Orgad Shaneh
2384865bff UnitTest: Adapt to Google Benchmark v1.5.4
Change-Id: I2c2a34206dbc01d277242f5d736eef3e1333b01f
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2021-08-18 11:58:46 +00:00
hjk
7c28c4f744 Utils: Introduce a FilePath constructor from char arrays
Similar to QT_RESTRICTED_CAST_FROM_ASCII to avoid the need for
decorations in user code.

At the same time, drop some convenience constructors and functions
in CommandLine and Icon essentially serving the same purpose.

Change-Id: Ida4e5ac19c2da0a4298a97b2a8e1511d56bbb79d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-17 05:34:10 +00:00
Marco Bubke
98cba6e50c QmlDesigner: Improve file status cache
It is caching the file size now too.

Task-number: QDS-4788
Change-Id: I5cb816b8359bf3d2ef372ea319ce5920d9e0e4e9
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-08-16 15:23:10 +00:00
Marco Bubke
4ebc0f5078 QmlDesigner: Add file status support to the project storage
Task-number: QDS-4785
Change-Id: Idaadf6992fad938e3620169a415f9d3cf7b9927f
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-08-16 15:23:04 +00:00
Marco Bubke
51452d0858 QmlDesigner: Add source path watcher
The watcher is only watching directories and then searches for file
stat changes. It is compressing signals too. So if files are changes
in a very short time frame they are compressed to one change.

Task-number: QDS-4776
Change-Id: I90052a0d5dba01467b505070fb58b04ea5576294
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-08-16 12:25:19 +00:00
Marco Bubke
19a30631af QmlDesigner: Improve support for explicit type names
Explicit type name ids are now saved as negative ids into the database
so they can be distingished by that 'flag'. For types we now use imports
and not anymore import ids. The resolving of the imports are done
internally to enable atomic synchronization.

Task-number: QDS-4662
Task-number: QDS-4725
Change-Id: Ia59763ec5578baec84f3c81fa1fd35ba075b8d84
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-08-16 12:25:00 +00:00
hjk
9e529bef7b QmlDesigner: Fix a "#pragme once in main file" warning
Change-Id: I0e6efe3c2cabb3a3c3e80ab5021a43809a6e279c
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2021-08-10 07:52:29 +00:00
Marco Bubke
3ed4c8dd05 QmlDesigner: Remove document imports for deleted documents
Task-number: QDS-4724
Change-Id: Ie5ec1788387c224b48380fa0f256b012f2b7dbcf
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-07-29 12:16:11 +00:00
Cristian Adam
dbdea46f66 Unittest: Allow standalone tests build without libclang
Without libclang, or for the MSVC case when libclang has been built
with a different CRT. (release vs debug)

Change-Id: Ia1c5adbd1f9126efb95f1517c8ff274b5919c10e
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2021-07-28 15:28:41 +00:00
Christian Kandeler
3edc5822da Unit test: Remove unused ProjectExplorer sources
Change-Id: If30f601955d287ab4db719f0499c9e92e6eefe02
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-07-26 10:11:19 +00:00
Marco Bubke
a98d2a6770 QmlDesigner: Imports updates are source id aware
Imports are now only updated for their source id. The source id is now
used as import id too.

Task-number: QDS-4724
Change-Id: I12988e9c19746291bbc26d5c80fc7dfdd33528e9
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-07-26 09:46:55 +00:00
Marco Bubke
1ba8899749 QmlDesigner: Atomic synchronize
Merging the synchronization function into one function. This is needed
to exclude inconsistent states of the database.

Task-number: QDS-4715
Change-Id: I9915726d78d81a471c0494c584f141f011714c39
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-07-26 09:46:37 +00:00
Marco Bubke
3591735293 QmlDesigner: Detect alias cycle
An exception is thrown if an alias cycle is detected. This prevents that
the designer would get in an endless loop.

Task-number: QDS-4682
Change-Id: Iffbfb42d7334aa2a5490fe2830b5cfab8c8e627a
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-07-26 09:46:04 +00:00
Marco Bubke
15f44db84c QmlDesigner: Support recursive aliases
So far we push changes up to aliases. But because we have recursive
aliases we have to separate different phases off the declaration and
linking. First we simply declare. Later we set the alias ids and then we
can find out the alias property types. To minimize the changes we stick
to the push model.

AliasPropertyDeclaration was merged into PropertyDeclaration so that
Sqlite::insertUpdateDelete can be called on one sequence. This prevents
inconsistent states as aliases would be changed into properties and vice
versa.

Task-number: QDS-4654
Task-number: QDS-4711
Change-Id: I8459ab07fd6b30efa19cfd4bc335286a039a511f
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-07-26 09:45:50 +00:00
Christian Stenger
805d19d1ed Unittest: Remove deleted file
Amends baa83725f6.

Change-Id: I9a5d3ad9a17dd37cdc39d05d0065022621219ab1
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-07-22 09:41:34 +00:00
Christian Kandeler
1275a12582 CppTools: Move SendDocumentTracker tests into plugin
Change-Id: I1d0532b5d0e155f6d53c683d01c4a92e4bae3ce9
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-07-22 08:55:46 +00:00
Christian Kandeler
da588b7cc4 CompilationDatabaseProjectManager: Move tests to plugin
Change-Id: Ife4ee68cdbd1560830f294610f8fab40653a4f5b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-07-22 07:45:19 +00:00
Christian Kandeler
1e912f7318 Unittest: Remove unused MockCppModelManager
Amends baa83725f6.

Change-Id: Iaee3b79d8aabcac5dee238692d66472881263764
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-07-22 07:30:44 +00:00
Christian Kandeler
a3d621fbde CppTools: Move ProjectFileCategorizer tests to plugin
Change-Id: I51d66d9ff9a14e2dd04cf25448ccc8c85bcbce97
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-07-22 07:29:46 +00:00
Christian Kandeler
0adb502457 Unit test: Remove some now-unused CppTools sources
Change-Id: I61a0d15ade5093c6e7eeb005efed5704764fe7a1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-07-20 12:38:28 +00:00
Christian Kandeler
18ab828b6b CppTools: Move HeaderPathsFilter tests to plugin
Change-Id: Iecbb0942bed51002e85b96f6cc2ab034622cd07f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-07-20 09:35:52 +00:00
Christian Kandeler
5ec52eef31 CppTools: Move ProjectInfoGenerator tests into the plugin
Change-Id: I40d4b0b9751e77a5bb605349c86b37ad3935ca59
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-07-16 12:09:48 +00:00
Marco Bubke
a30775a19e QmlDesigner: Prevent prototype chains cycles
A cycle would lead to an endless loop. So we throw an exception for
synchronization. Maybe we can add later more information to user so
he can easily resolve the error.

Task-number: QDS-4457
Change-Id: I83092ccdff030a610942c155571a0bfa899e808c
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-07-15 07:05:00 +00:00
Marco Bubke
e9407c23fa QmlDesigner: Relink prototypes
Task-number: QDS-4552
Change-Id: Ibb0d0048c114e100c215493bc9d633d4dbe3c4e0
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-07-14 10:44:57 +00:00
Marco Bubke
32fd70ce3c QmlDesigner: Handle more corner cases for alias relinking
Synchronization should always throw an exception if it gets in an
inconsitent state.

Task-number: QDS-4551
Change-Id: I8c55198115aa79b676a13fe0cd7ab225fb6723d5
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-07-14 10:44:52 +00:00
Christian Stenger
39b8501fa1 Unittest: Fix compile when building standalone
Amends 58d00f37d4.

Change-Id: Iafd5b1c4f78077ae75f17ca7b315916e10916a1b
Reviewed-by: hjk <hjk@qt.io>
2021-07-09 06:25:32 +00:00
Eike Ziller
1d05a2b5af Merge remote-tracking branch 'origin/5.0'
Change-Id: Icea9215204a7247c5fbbc818833132676a3b9e11
2021-07-06 16:00:14 +02:00
Christian Kandeler
8cc4bbe4d8 ClangFormat: Prepend a space character to our inserted line comment
Otherwise, we could introduce unwanted syntactical constructs, for
instance if the previous character is an asterisk.

Fixes: QTCREATORBUG-25966
Change-Id: Ic0b535861bc1cb4f5f93d06bb11d0f3c7c583893
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-07-05 15:44:51 +00:00
Marco Bubke
b1fcc4b7a0 QmlDesigner: Relink alias properties
There are still some corner cases but this will be done in follow-up
patches. The link information moved to the typenames table so only
indirections are saved in the propertyDeclarations table. Otherwise
the duplication would increase the database size too much.

Task-number: QDS-4551
Change-Id: I4aca85dd2d803b43aa9860183e500ced2d91141f
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-07-05 12:40:49 +00:00
Christian Kandeler
f248d0a737 ClangFormat: Add xfailing unit test
Task-number: QTCREATORBUG-25966
Change-Id: If8f28bd5195f2681cca209b41bcc93fad0695541
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-07-05 11:26:09 +00:00
Marco Bubke
8f4a06664f UnitTests: Update to google test 1.11
The new version improves the mocking support quite a lot.

Change-Id: Ia59513ad251a084f8baca8178d9d5a9079bd63ef
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-07-05 10:28:57 +00:00
Orgad Shaneh
84839ee397 Merge remote-tracking branch 'origin/5.0'
Change-Id: Ia018600fb257c9523fc9d15faa5bd8300840e3de
2021-07-05 12:17:45 +03:00
Christian Kandeler
32f46e55ed CppTools: Move ProjectPartChooser tests into the plugin
Change-Id: Ic2ef95d4d6a5bd65cbc611b66a0b297c7468bbcb
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-07-05 07:38:10 +00:00
Christian Kandeler
01a6e40377 Unit test: Fix qbs build with internal gtest
Change-Id: Ied99b436ae234e7be3944e71d0f6d13fc5f7b2f3
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-07-02 13:29:02 +00:00
Christian Kandeler
85797068bb CppTools: Move CompilerOptionsBuilder tests to plugin
... where they belong.

Change-Id: Ifc6aebc218f9f85ffeb6a4b7121f97379b53b69d
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-07-02 13:12:54 +00:00
Christian Stenger
8747e2fe1f Unittest: Fix compile
Amends a58dd22f2d.

Change-Id: I85978b4cc39c633f882c22f74335f11b0dfdfe09
Reviewed-by: hjk <hjk@qt.io>
2021-07-02 08:16:19 +00:00
Marco Bubke
31ee498ab9 UnitTests: Remove deleted file from .pro
Change-Id: If09216c281f8186ae03c59c685653faa6dbdcd89
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
2021-07-01 11:33:02 +00:00
The Qt Project
35b169f466 Merge "Merge remote-tracking branch 'origin/5.0'" 2021-06-28 09:41:13 +00:00
Marco Bubke
091c7a0093 Sqlite: Disable value method for fundamentals
There is optionalValue which can handle a null value. ints and floats
can be initialize to zero but you cannot be sure that this value comes
from the database, is a empty value. So it's better to force
the use of optionalValue for ints and floats. In that case empty has
to be handled.

Change-Id: Id5c5db57a8d3335d91911824d06f388ed054df9e
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
2021-06-28 08:08:59 +00:00
Christian Kandeler
627dd6681b Sqlite: Fix warnings
- use of uninitialized value
- unused local typedef

Change-Id: I60d6c3a9a04d9f603a102439582c9e55d85a191f
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-06-24 12:07:48 +00:00
Eike Ziller
487e4a2e51 unittest: Add missing tests (QmlDesigner, ClangTools and a few others)
Ups it to 2487 tests from 110 test suites.
(from 1963 tests from 91 test suites)

Change-Id: Id601bc8bbd43f129956be812e30a94081098c3cb
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2021-06-17 14:44:20 +00:00
Cristian Adam
4bfcea22bf CMake: Allow standalone build of unittests
tests/unit/CMakeLists.txt needs to be opened for standalone usage.

Change-Id: Ib763dedd09ee00bc793b56d87456981b71f4004c
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2021-06-17 09:39:58 +00:00
Eike Ziller
d23cf2cced unittest: Fix build on macOS
We are still using our own Utils::variant and corresponding functions
on macOS.

Amends 90cc7fed3b

Change-Id: I829bdd3a4cc03f994a825ee3a962d4eb523a3bf1
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2021-06-15 10:50:13 +00:00