Commit Graph

1150 Commits

Author SHA1 Message Date
Eike Ziller
baa83725f6 Remove ClangRefactoring and ClangPchManager
This removes the plugins and tools, and removes all the tests that would
fail to build because of that.

Fixes: QTCREATORBUG-25659
Change-Id: I8adb5d503fc8eea313bcaada421f309dbbfa8c26
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2021-06-15 10:07:57 +00:00
Marco Bubke
3112d063e8 QmlDesigner: Update alias property declarations
Alias property declaration removal is now done before the normal
property declarations are synchronized.

Task-number: QDS-4525
Change-Id: Icddf5e041b672e4abfab89540906bbfdcc1a10ba
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-06-14 12:08:38 +00:00
Marco Bubke
b32f607bc7 Sqlite: Add condition to index
Change-Id: I83851b2f9cd516f21bc7e8987c1b60efaa019bb1
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-06-14 12:08:31 +00:00
Marco Bubke
66ba9c4843 QmlDesigner: Synchronize alias properties
Alias property declarations are handled like normal property declarations
except that the have an value for the target property declaration id.
So they are distinguishable by the alias id. If it is not set it is a
normal property declaration. If it is set it is alias property
declaration. Alias property declaration are always synchronized after
all normal property declaration are synchronized. This synchronization
is not checking if the target property declaration changed. This update
has to be executed by the target property declaration.

Task-number: QDS-4524
Change-Id: I483840c821e12c93f1be67bf5ed6da396f8b45a3
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2021-06-14 12:08:24 +00:00
Marco Bubke
90cc7fed3b QmlDesigner: Handle implicit and explicit type names
Types are now handled by their import. Impicitly by an import list or
explicit for exported type.

Task-number: QDS-4496
Change-Id: I63f40df32760389e25b73597b4363f95ee304592
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-06-14 12:02:44 +00:00
Marco Bubke
4a04e75a4d UnitTests: Remove indexer printer
Remove the print functions for the indexer, clangrefactoring and
all dependencies.

Task-number: QTCREATORBUG-25668
Change-Id: I15c21322cf6f6c235d4757e32180e3d8812828a3
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-06-14 11:19:19 +00:00
Cristian Adam
aef432ec13 CMake: Add BUILD_TESTS CMake variable to filter tests to build
This allows building one test: -DBUILD_TESTS=tst_my_test, this will set
BUILD_TESTS_BY_DEFAULT to OFF (default value is ON) and set
BUILD_TEST_TST_MY_TEST to ON.

Change-Id: I7800f3d238121725bb9fa4146f76ddcd2b10bde9
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-06-11 13:40:24 +00:00
Eike Ziller
dcfc467959 Revert "CMakePM: Filter test also by BUILD_EXECUTABLES list"
This reverts commit 99396421de.

The patch does not solve the use case (building Qt Creator without
tests and then only building individual tests), and has lots of
side effects like tests landing in the application bundle on macOS
and in bin on Windows, and tests being installed.

Change-Id: I593627b55577e13a3d2cf1758deac99efa521954
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-11 11:49:08 +00:00
Cristian Adam
99396421de CMakePM: Filter test also by BUILD_EXECUTABLES list
This way one can build only one test.

Change-Id: Iebf9686108988793193106ebed312f7e86ee2e61
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-06-10 16:47:44 +00:00
David Schulz
0cfe27a53d Debugger: filepathify DiagnosticLocation
Change-Id: Ibbbf137231b313ec10e3d57c0230217b0c1e0a6c
Reviewed-by: hjk <hjk@qt.io>
2021-06-09 06:57:42 +00:00
Marco Bubke
d3a91cd3a7 QmlDesigner: Use import in exported types
We can remove the version from exported types because the are
implicit by the import.

Task-number: QDS-4458
Change-Id: I4a259dff5e59537b72a57d7df95256a38d036e7b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-06-08 14:25:28 +00:00
Marco Bubke
f32207c930 QmlDesigner: Add importId to types
If we now try to synchrize to an inconsistent type model we get an
exception.

Task-number: QDS-4458
Change-Id: I86f7ce90d14b18227a66314fb341f5b528bdfb95
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-06-08 14:25:23 +00:00
Marco Bubke
fc0668882d QmlDesigner: Add Import Synchronization
Task-number: QDS-4460
Change-Id: Icd419baa7881fe882539f10d335ab6b3d36bc7b5
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-06-08 14:25:19 +00:00
Marco Bubke
029aecef1e QmlDesigner: Synchronize type
A type should not removed but all it's fields should be reseted. This
has the advantage that if you remove a file and add it again later the
id is stable.

Change-Id: I3a1f51e14195cff2fc39681acdf7072d1a2e4616
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-06-08 14:25:09 +00:00
Marco Bubke
da267946d9 QmlDesigner: Sync project storage
Task-number: QDS-4423
Change-Id: Ia99df711effff2909b0a57ecebfb386ca51165f8
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-05-31 16:43:19 +00:00
Marco Bubke
8603eb5ba9 Utils: Remove std::initializer_list contructor
If you write

Utils::SmallStringView view;
Utils::SmallString text{view};

it selects the std::initializer_list contructor. Not the didicated
constructore. It is much to easy to get it wrong so it is better
to make it explicit.

Change-Id: I4240eaf1f39cf71d37df4480fea1ecfa3ea83cb0
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-05-31 16:43:11 +00:00
Marco Bubke
7b330d3496 Sqlite: Add insertUpdateRemove
An generic approach to merge values into a database. It is comparing
two ranges. The first range is the Sqlite select range and the second
one which are the new values. New values are inserted, change are
updated and missing values are removed. Unchanged values are not
touched. The compare function is comparing a key. Both ranges are
binary ordered.

Change-Id: I973c83677ea74f8fa62bd7ab8a73ed560c806562
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-05-31 16:43:02 +00:00
Marco Bubke
b2cd0c32a5 Sqlite: Open Sqlite by default in exclusive locking mode
There are no extra files for the WAL in the excusive locking mode and
it can be even faster because the logging is happening on the heap.

Change-Id: I59d75dd2aa95d802ba67c8534a5cd8ab32a343df
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-05-31 16:42:20 +00:00
Marco Bubke
494469641a QmlDesigner: Move source cache types to their own header
The namespace is now Cache for that types.

Task-number: QDS-4306
Change-Id: I479f1ca534455a41de9dc1d6a1fd891e1d8973eb
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-05-31 16:37:59 +00:00
Marco Bubke
b3bed53c4f QmlDesigner: Add SourcePathCache
Task-number: QDS-4306
Change-Id: I5adbf3893cb198c52c1fd433f599d21317c6881c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-05-31 16:37:08 +00:00
Marco Bubke
f7d09630b7 QmlDesigner: Add sqlite function unqualifiedTypeName
Task-number: QDS-4305
Change-Id: Ic9f16c6d5e9af8a3a6ffaff817c3b82af0fc8d61
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-05-31 16:36:35 +00:00
Marco Bubke
019d948552 QmlDesigner: Move project storage to projectstorage subdirectory
We save their not meta info related data. So it is better we move it
their own subdirectory.

Task-number: QDS-4304
Change-Id: Ib99419e992fced93fb245a8c48e02ee256823def
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-05-31 16:32:12 +00:00
Marco Bubke
e4fea9f159 QmlDesigner: Add project storage
Task-number: QDS-4252
Change-Id: Ic74e027b20bc41f3712e3ae155cddc64f8972cb0
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-05-31 16:16:48 +00:00
Marco Bubke
ef4f2a4dcf Sqlite: Add unoptional value fetcher
There is now value, valueWithTransaction, optionalValue and
optionalValueWithTransaction. Sometimes you want to return
the default constructed value as default. So this is now possible.
This simplifies some code but can be even more optimal.

Change-Id: Ibbb6b5ca47803344ed646bfa257602b6db52e0fe
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-05-31 16:10:09 +00:00
Marco Bubke
c78d1c171f Sqlite: Add *WithTransaction fetcher
There are many simply fetch functions which can now be simplified.

Change-Id: Ibf542ee8b07a1b06ea3dae695da1f69065e9dd71
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-05-31 16:07:30 +00:00
Marco Bubke
5fda083436 Sqlite: Add exception if statement is called outside of a lock
Sometimes it is really hard to trace if sqlite statement is called
outside of a database connection lock. So we know throw an exception
in the unit test. So we get failing tests.

Change-Id: I71485b9473075751a2fb771ce7e2954e28d8413e
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-05-31 16:07:14 +00:00
Christian Stenger
73c2a98b39 Utils: Make Link a class
Change-Id: Ia2f1c9589f65064eca2416b093b3fecf568058d2
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-05-31 06:45:03 +00:00
David Schulz
356bfcc9fd Utils: filepathify Link
Change-Id: Ie62500bde139158e776f9698ee0ea00c2a113f93
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-05-25 17:32:18 +00:00
Christian Stenger
c6213df1c6 Unittest: Fix source location after merge
Change-Id: I671f6d8edd3d2989b0b1d1af86e2a3abac9a6c48
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-05-21 17:41:48 +00:00
Eike Ziller
f83be6debe Merge remote-tracking branch 'origin/4.15'
Change-Id: Ia6558fc2423fd9cd84ca2282bfa60d102dff682e
2021-05-19 09:54:07 +02:00
Christian Kandeler
124b7ad911 Unit test: Fix build
Amends a13aef759e.

Change-Id: I07fbb52b741a765fc9aa92f4f4752890b581ed35
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-05-18 15:01:42 +00:00
Christian Kandeler
2182993b97 clangbackend: Add another exception to our "find real cursor" heuristic
Leave preprocessor directives alone.

Fixes: QTCREATORBUG-25692
Change-Id: I1c31f4120e9b86a58123f8877cebd354e800fb8b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-05-17 11:44:49 +00:00
Christian Kandeler
3113b0e6d6 clangbackend: Fix token length calculation
This was broken for tokens with characters that take up more than one
byte.

Fixes: QTCREATORBUG-25715
Change-Id: Ic9842b960af8d6f12487f582b100cb2edcf48cc1
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-05-17 08:35:32 +00:00
Eike Ziller
bf5b1d714c Revert "Revert "Merge remote-tracking branch 'origin/4.15'""
This reverts commit f0a86d4510.

Reverting a merge doesn't "undo" it - the changes would be lost
forever even with subsequent merges.
So we need to revert the revert to get the changes.

Change-Id: I65928f876f4dc886561bed17c4b2aa42b388c1e3
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2021-05-07 09:07:40 +00:00
Marco Bubke
f0a86d4510 Revert "Merge remote-tracking branch 'origin/4.15'"
This reverts commit 888ca0dd20.

Reason for revert: wrong patchset

Change-Id: I1291789938601aaf606c59917ff938e3c24c78dd
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2021-05-06 15:30:02 +00:00
Tim Jenssen
888ca0dd20 Merge remote-tracking branch 'origin/4.15'
Conflicts:
	src/libs/sqlite/sqlitebasestatement.h
	src/plugins/qmldesigner/qmldesignerplugin.cpp

Change-Id: I0fa0a8a7feffed24c0d2bc26eca86590f1156755
2021-05-06 13:07:48 +02:00
Marco Bubke
1618937637 Sqlite: Use config.h instead of setting everything in the build files
Change-Id: Ia70a5e78475a8b8078276df03330060c8785bf90
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-05-05 15:14:49 +00:00
Marco Bubke
f8647ec428 Sqlite: Enable SQLITE_DEBUG for debug
Change-Id: I086dc07ae7672d1077f8469eccac5ce34d56c04d
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-05-05 15:14:44 +00:00
Marco Bubke
81a36ac0ef Sqlite: Optimize the initialization
https: //www.sqlite.org/compile.html#omit_autoinit

Change-Id: Iaa91203be21f01a19235a9401cb4fa412eca8276
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-05-05 15:14:37 +00:00
Marco Bubke
8edbdd78ad Sqlite: Default column type to None
None has no type affinity. So it will not try to convert types to other
types like Numeric will do.

Change-Id: I5362a6d071459594619485b8b8a37b3f5ed12db6
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-05-05 15:14:18 +00:00
Eike Ziller
b3a893e9b8 Merge remote-tracking branch 'origin/4.15'
Change-Id: I75ffc79eeb8d73296a2271a636fae48e35427947
2021-05-05 11:46:19 +02:00
Christian Stenger
c362df32ee Unittest: Fix writing CppTools.json in cmake build
Do not write additional garbage into the json file as this
will end up in a parse error.

Change-Id: I02783b5e94b016d35962ee5729d53bc218d42b42
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-04-30 08:18:08 +00:00
Marco Bubke
c4c3d4cc33 QmlDesigner: Remove findInSorted function
Using std::lower_bound is more generic and we have less code which
could lead to less bugs.

Change-Id: Iacf6ea550182b51a8d5dd6b18a92de68914f4df1
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-04-27 10:26:03 +00:00
Marco Bubke
3862f67b8d QmlDesigner: Improve storage handling in StorageCache
Using an explicit class for the storage not even makes the code easier
to understand but enables the possibility of code optimizations too.

Change-Id: I9239919d3385ba1bf141c23bdc3013b6c1e624ed
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2021-04-27 10:25:58 +00:00
Marco Bubke
c236a25339 QmlDesigner: Add storage cache
Task-number: QDS-4237
Change-Id: I7d587f615b5e26cc6014ea3a63dedd203fdd35eb
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-04-26 14:52:24 +00:00
Marco Bubke
f69314b6ae Sqlite: Add range getter
Sometimes it is handy to return a range so you can break in a for range
loop. So you can now write:

for (auto [key, value] :
    statement.range<std::tuple<long long, std::string>>()) {
    values.push_back(value);
    if (value == Tuple{"foo", 23.3, 2})
         break;
}

for (auto [key, value] :
    statement.rangeWithTransaction<std::tuple<long long, std::string>>()) {
    values.push_back(value);
    if (value == Tuple{"foo", 23.3, 2})
         break;
}

It will only step over the statement to the break. So you don't fetch
not used values anymore. The second version will add a transaction
around the range.

But be careful. The range is view to the statement. Holding it longer or
reusing it can lead to strange behavior because the state of the
statement is changing.

Change-Id: I90191f7da5a015c7d8077d5bc428655a2b53246c
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2021-04-26 09:42:40 +00:00
Marco Bubke
44b4c461ff Sqlite: Fix sqlite
Missed to remove the not anymore used ResultTypeCount.

Change-Id: Ia150e945bd650cc1e3d19fcb9426621d93fa16c3
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2021-04-26 09:06:50 +00:00
Eike Ziller
3d1ad9db60 Merge remote-tracking branch 'origin/4.15'
Change-Id: I1d13f3543ab4bb17f0cbfe26bbea3f154f856ca6
2021-04-20 10:42:55 +02:00
Marco Bubke
5203c478a5 QmlDesigner: Add some useful iterator algorithms to NodeListProperty
Now there is iter_swap, rotate and reverse in the node list property. With
that methods we can implement slide too.

Task-number: QDS-4159
Change-Id: Ie7f80f64fd26e517ca696158a878262928dc82c4
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-04-19 12:25:29 +00:00
Marco Bubke
2bf45ec998 Sqlite: Fix handling of blob and blob views
Change-Id: I90c31307ff3299975f820e191085ba93ed8afe0f
Reviewed-by: Henning Gründl <henning.gruendl@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2021-04-19 12:25:22 +00:00