Commit Graph

1122 Commits

Author SHA1 Message Date
Marco Bubke
9d24d886e2 QmlDesigner: Add imports for qml document parser
Task-number: QDS-5174
Change-Id: I78b7b31108b498035eccb8385ffab621c727cd89
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-11-17 13:41:28 +00:00
Jarek Kobus
3562c5e96e Remove unneeded includes of QProcess from cpp files
QProcess wasn't used in these files.

Change-Id: I24900bcf312eb6ea1ca3bc0c753cebb505ec552b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2021-11-01 12:04:41 +00:00
Artem Sokolovskii
a013d75728 CppEditor: Change parsing opposite bracket
Fixed behavior:
- when comparing sign was determined as angle bracket
- when in complex combination brackets, an opposite bracket
was detected not correct
- not correct mismatch case highlightning
Added tests for the cases form bug 26395

Fixes: QTCREATORBUG-26400
Fixes: QTCREATORBUG-26395
Change-Id: Ic45566d2677f80fb9a8e4fe830307254dd1db51d
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-10-25 14:07:44 +00:00
Jarek Kobus
0101808407 Refactor HighlightingResultReporter
In some unlikely circumstances it may happen that
HighlightingResultReporter might be destroyed before
returning from the HighlightingResultReporter::start()
function. This may lead to undefined behavior.

Refactor the HighlightingResultReporter so that instead
of using QRunnable subclass we define simple function
returning the QFuture object directly.

Change-Id: Ib833771a7e46e87c83d10b59ca056a0147fabe88
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-10-21 07:38:53 +00:00
Marco Bubke
428a9ee509 QmlDesigner: Use one synchronization struct
The arguments of the synchronization function are changing constantly, so
all tests have to adapted even for default arguments. To reduce this
changes now a struct is used as parameter.

Task-number: QDS-5196
Change-Id: Id3b6a530bcb8ab043eccce6526088f345d746235
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-10-20 16:42:47 +00:00
Marco Bubke
b4fcd05451 QmlDesigner: Introduce different modules for cpp, qml and directories
There are now different modules for qml, cpp and directory imports.
Cpp imports are qml import append by "-cppnative".

Task-number: QDS-5196
Change-Id: I599b224892c5ada0224a765d0bde8b32de20b061
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-10-20 16:41:55 +00:00
Marco Bubke
cb946ec307 QmlDesigner: Support multiple module ids per type
The type will be use source id and name instead of module id and name as
key.

Task-number: QDS-5236
Task-number: QDS-5238
Change-Id: Ibc9c298dc0a6363b630173ec4981d574cecd02ff
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-10-20 16:41:34 +00:00
Marco Bubke
1b16eb209c QmlDesigner: Add QmlDocumentParser and QmlTypesParser
Task-number: QDS-5174
Task-number: QDS-5228
Change-Id: I0889e8d63b0260aeb0efae1b3c8a373c18ea1f03
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-10-14 07:40:49 +00:00
Tim Jenssen
6860e361a4 qmldom: fix output path
Change-Id: I137accdb788fa4686a0c70dfcc1b66a6c576dcff
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-10-06 08:15:19 +00:00
Eike Ziller
050af56000 Merge remote-tracking branch 'origin/6.0'
Change-Id: If773f217a9708ce0ad0b8adeefe3266ba0371a32
2021-09-29 12:54:38 +02:00
Tim Jenssen
3ed8d60756 QmlDesigner: Integrate QmlDom
Task-number: QDS-5172
Change-Id: Ib17c38ef7b89b05daababaad1f8e2dc39d53a2bf
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2021-09-28 11:32:34 +00:00
Jarek Kobus
7958de05f5 Introduce Utils::Singleton
Introduce Utils::Singleton class and
Utils::SingletonWithOptionalDependencies class template
that helps implementing singletons that depend on other
singletons. It's guaranteed that whenever singleton B depends
on singleton A, than A is always created before B is being
created, and that the order of destruction is always
opposite to the order of creation.

Dependencies of singleton are listed as template arguments
for SingletonWithOptionalDependencies class template.
The first argument of SingletonWithOptionalDependencies
class template is always a singleton class itself.

Prepare a common interface for all singleton subclasses:
SingletonSubClass *SingletonWithOptionalDependencies::instance();

Make instantiating singletons and its dependencies thread-safe.

Create singletons on demand (only if some code needs them).
It's not needed anymore to explicitly instantiate
all required singletons in tests.

Make it possible (and thread-safe) to instantiate ProcessReaper
and LauncherInterface singletons in non-main threads.

Make the following dependencies between existing singletons:
   SshConnectionManager depends on:
-> LauncherInterface depends on:
-> ProcessReaper

Change-Id: Iefaacab561c2b3dcf07e7fafbb87339ea6a15278
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-09-28 10:25:29 +00:00
Marco Bubke
9e29b602d4 QmlDesigner: Use ModuleId for Type instead of Module
We already know the module id because it's the source id of the module.

Change-Id: Ice241d38c12c7ca79a525464c53b7d552095a0fc
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-09-27 13:00:25 +00:00
Marco Bubke
03687c1d02 QmlDesigner: Add minimal updates
Exported type names are synchronized so that old type names are removed.

Task-number: QDS-5130
Task-number: QDS-5126
Change-Id: I6e6482170c8197f37f60a57bdfb7f1b450001b4b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-09-27 13:00:21 +00:00
Marco Bubke
b2a300dd60 QmlDesigner: Refactor ProjectStorageUpdater tests
Change-Id: I0174153a470ce3009945df9cd2a822150f2f19f4
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-09-27 13:00:18 +00:00
Marco Bubke
091f157192 QmlDesigner: Adapt project storage changes in updater
Task-number: QDS-5123
Task-number: QDS-4923
Task-number: QDS-4925
Change-Id: I79acbbdb11bf7a0529c1ef005e6b5e1fd0d12aa7
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-09-22 11:22:11 +00:00
Marco Bubke
6587feb3d8 Utils: Improve string conversion for Qt6
Skip the creation auf a QByteArray. Use QStringEncoder instead.

Change-Id: I3d2297b1fef27acb2136a64587c5af9099d92aa6
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2021-09-21 12:45:51 +00:00
Marco Bubke
728be60986 QmlDesigner: Change import export architecture
The new architecture should be a better abstractions for qml.
ImportedTypeNames are introduced. ModuleDependencies are now taken
over by document imports. Modules lost their version and
ExportedTypeNames gained it.

Task-number: QDS-4938
Task-number: QDS-4933
Task-number: QDS-5009
Task-number: QDS-5032
Change-Id: Ia86921c5be9107fe7d5bfd28f12bf8453769dc10
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-09-20 07:29:22 +00:00
Marco Bubke
13aaea197b QmlDesigner: Rename Import into Module
Task-number: QDS-4933
Change-Id: Ibc28ae731ffb27734f61eb438230fa58fe800bdc
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-09-20 07:29:15 +00:00
Marco Bubke
a570d53db2 QmlDesigner: Add ProjectStorageUpdater
Adding a skeleton for the ProjectStorageUpdater.

Task-number: QDS-4819
Task-number: QDS-4793
Change-Id: I230d68f71480d360d71019883510ef22dd276802
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-09-20 07:28:59 +00:00
Jarek Kobus
ace765c199 Move ProcessReaper into lib/utils
Reuse ProcessReaper inside process launcher.
Automatically reap all internal QProcesses of QtcProcess
(either direct child of QtcProcess in QProcessImpl
or indirectly inside process launcher).
Make ProcessReaper work again on QProcess instead of on
QtcProcess, so it may still be reused for non-QtcProcesses.

Change-Id: I950cac5cec28f17ae97fe474d6a4e48c01d6aaa2
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2021-09-06 21:28:19 +00:00
Jarek Kobus
8724a4efbb Use QtcProcess for clangbackend
Change-Id: Ifdcdba765409a09861f81dd3dff405115a986801
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-09-03 14:06:56 +00:00
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