Commit Graph

2507 Commits

Author SHA1 Message Date
Christian Stenger
402231c5d9 Tests: Fix build
Amends 509f40825a.

Change-Id: I4eaca8f1ad43ab8f3e5e92d313de334f42ed4905
Reviewed-by: hjk <hjk@qt.io>
2021-04-30 08:17:59 +00:00
Alessandro Portale
dba1468b35 ProjectExplorer: Fix tst_toolchaincache dependencies (CMake)
idevice.h(33): fatal error C1083: Cannot open include file:
'QAbstractSocket': No such file or directory

Change-Id: I4398c546af31e92c111d06f651270ef5c64a30bd
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-04-29 07:58: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
2e8e47622c QmlDesigner: Split nodeOrderChanged notifier
For swap we cannot provide all the arguments and they are only used in the
rewriter. So we use now a simplified notifier for all views except the
rewriter view. After the introduction of the new rewriter we can remove
the old notifier.

Task-number: QDS-4159
Change-Id: Idc91a618ea40da0bda9856888d115a84016597d5
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-04-19 12:25:02 +00:00
Andre Hartmann
2df71c5798 Lexer: Support the integer suffixes LU and LLU also
Before we only supported UL and ULL.

And add tests for all variants of allowed integer suffixes.

Fixes: QTCREATORBUG-25604
Change-Id: Id92f371d2effa7456d2d50891a6c29810c5c4c75
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-04-19 09:16:55 +00:00
Jochen Becher
05324cf21f Extend Utils::FilePath for relative paths
The new methods allows converting a path to a file or directory into a
path relative to another path to a file or directory.

Change-Id: I8c743d5bced9fec81b05ce94ac2b7bec307d9028
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-04-19 04:55:54 +00:00
Eike Ziller
872660fcc5 Merge remote-tracking branch 'origin/4.15'
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri

Change-Id: Ibc60debb3c409ae27e99df6071cf6115b272d6d8
2021-04-15 15:48:30 +02:00
Christian Stenger
915b9d0e31 DumperTests: Ensure a set up environment
For whatever reasons the qmake call already needs an
environment containing cl on Windows if QC and the auto
tests have been built with cmake.

Change-Id: I7b55fb792d3bc282cc1561e8e3b55885a25bcf0e
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-04-14 13:49:43 +00:00
Erik Verbruggen
5ad724a3ac Support for QML module mapping
QUL uses module mapping for theming of QtQuick.Controls: during
code-generation the compiler is pointed to the Controls implementation
it should use. This is done by rewriting any import of QtQuick.Controls
with the given module name. The CMake build scripts will write a file
for each target to the directory "qml_module_mappings" in the build dir,
and those files will contain the mappings used.

Fixes: QTCREATORBUG-25356
Change-Id: I3f74897836dde7717b03bd6dffa46dcc0689ffdd
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io>
2021-03-19 10:43:23 +00:00
Alessandro Portale
93fbd5be02 Remove dead code "< QT_VERSION_CHECK(5, 14, 0)"
Qt Creator required Qt 5.14 or higher. Let's removed the #idef-ed code
for building against lower Qt versions.

Add a comment in porting.h where we still need such code for sdktool.

Change-Id: Ib330275208eec4a2f285b4b9f480530c171f538a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-03-18 19:12:39 +00:00
Eike Ziller
bce64778c5 Merge remote-tracking branch 'origin/4.15'
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qtcreator_ide_branding.pri

Change-Id: I009308451e1c6276692412f498125d79a8f12a07
2021-03-11 14:10:14 +01:00
Christian Stenger
2b5f7316ac Tests: Work around problems in execution of dumper tests
On several machines the QDir test interferes in a not yet known
way and makes all following tests fail. Moving it to the end
makes the problem vanish.

Change-Id: Ic8e7fdaaf9581be0cdd5666c7d2f12a2e8ed80ee
Reviewed-by: hjk <hjk@qt.io>
2021-03-11 09:05:04 +00:00
David Schulz
d17277b546 LSP: reduce error handling complexity
Instead of checking recursively every possible object just check the
required keys for an object and validate it on construction or
assignment from json.

This will reduce the implementation effort for protocol extensions and
also reduce the false positives we might get if the protocol gets
updated.

Change-Id: I3df24e62430d2c7575d26c1581e6a9606e7da4c1
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-03-02 12:51:47 +00:00
Fawzi Mohamed
9e4e44d180 qmljs: preserve default arguments when reformatting QML
Fixes: QTCREATORBUG-23009
Change-Id: I9949fe26a91a063c4804fddcca4e26d14bc5cd61
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-03-02 08:29:42 +00:00
Fawzi Mohamed
0ff75a721f qmljs: reformat inline components
Fixes: QTCREATORBUG-25381
Change-Id: I472105cd6436d4d0ae7369880c332b8f4a2321ad
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-03-02 08:29:29 +00:00
Fawzi Mohamed
c57f6a703b qmljs: correctly handle required and readonly properties
* correct indentation after required property QTCREATORBUG-24144
* handle required <name> statement
* allow default readoly required reordering
* more permissive than the actual parser (which then will show errors
for invalid sequences)
* backport form QmlDom

Fixes: QTCREATORBUG-24144
Change-Id: I19166ca65d108d533a1ed3748c09e35bcfdbc56d
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-03-02 08:29:13 +00:00
Eike Ziller
0f5b6c82ee Merge remote-tracking branch 'origin/4.15'
Change-Id: Ifae18bacb0c4bdb1e0516c9f92c0fd16150e35e6
2021-03-01 09:56:20 +01:00
Christian Kandeler
a995a4633f CPlusPlus: Do not mis-classify bitfield declarations as initializations
Fixes: QTCREATORBUG-25390
Change-Id: I1976b7db2996f5a09db73adbd127aac9ab92d57d
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-25 15:55:54 +00:00
Fawzi Mohamed
bd05384765 qmljs: handle string templates in scanner
* add (multiline) template string support
  templates can be nested, which means that the scanner/lexer cannot
  be a simple state machine anymore, but should have a stack to store
  the state (the number of open braces in the current template
  string).
  The lexer stare is currently stored in an int, so we abuse that and
  store a the number of open braces (maximum 0x7f = 127) for at most 5
  nested templates in the int after the flags for the multiline
  comments and strings.
* improve representation of delimiters (==, <=, ||,... not split in
separate delimiters)
* (QmlDom backport)

Change-Id: I2b4d23b65febedef29a748f4c5f377fde27bd7fd
Fixes: QTCREATORBUG-22766
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-02-25 08:37:12 +00:00
Fawzi Mohamed
c0f9f29097 qmljs: correctly reformat js spread operator (...)
Fixes: QTCREATORBUG-23402
Change-Id: I6b4bd0846dac67116711b7ed046bd52d137b7674
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-02-23 12:38:55 +00:00
hjk
34945f84e4 Debugger: Use a class for GdbMI parser parameters
Currently only the previous from/to pair, but can be extended
by codec state.

Task-number: QTCREATORBUG-24462
Change-Id: I3d101e74d1fef65bb75ddaab1dc2eaf77201dcde
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-02-18 06:07:36 +00:00
Christian Stenger
ec9a72808f Tests: Fix pluginspecs test for cmake
Change-Id: I700bd9cbcdabfa08863ffb727a084a9339e660d5
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-02-10 05:24:38 +00:00
Christian Kandeler
59d24fa268 Fix warnings about unused variables
Change-Id: I0bb76529a28c4288967cb79972c1863a0b1c84c6
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-05 08:51:44 +00:00
hjk
a5b93b54c8 CPlusPlus: Add missing line and column info for lambda functions
Task-number: QTCREATORBUG-25242
Change-Id: I5032bb04879e30f5516471e2038dc4b6bb3477f8
Reviewed-by: hjk <hjk@qt.io>
2021-02-05 08:51:09 +00:00
Christian Kandeler
bcde1ead55 Fix qbs build
Change-Id: I2e5e385a938343b2dbc487f79e3cf6c7fb2199fa
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-02-03 16:54:42 +00:00
Fawzi Mohamed
7015ef04b7 qmljs: add check for comparisons not depending on values
currently we mainly try to warn about primitive == null/undefined or
primitive === non primitive.
There are other that we could warn about null==null null==undefined,
but I feel that they might be triggered too much by clean code.

Change-Id: Id43d838d60a4e13f361be34e4bb38211777a081e
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-02-03 14:05:16 +00:00
Fawzi Mohamed
cc00af8334 qmljs: fix qmljscheck
* fix ASTVariableReference::value: correctly get reference value type
by using either initialiser of bindingTarget (broken since a codemodel
update in 2018)
* disable warning for casting in bool to null comparison (it does not
cast, is always false)
* fix property checks (where skipped without default of readonly)
* remove non relevant checks (ErrInvalidPropertyType for lowercase  now that custom
value types are supported, and for properties called data)
* updated import version

Change-Id: I38407acf327d0f773b38dda4c02fb4d95a420851
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-02-03 14:03:44 +00:00
Fawzi Mohamed
5c1cbf6b3f qmljs: support inline components
* add inline components to bind.
* inserts inline components in the component that contains them (makes
  Context:lookupType simpler)
* unify Context:lookupType overloads without adding extra heap allocations
  using a template (avoid code duplication)
* add tests for inline components
* warn about nested components
* use model manager to load dependencies in tst_check (old test did
  not load dependencies and simply skipped all checks on imports)

Fixes: QTCREATORBUG-24766
Fixes: QTCREATORBUG-24705
Change-Id: Ibcade7752cdaa08e960f66db3a724ab7fb3268cf
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-02-03 09:53:08 +00:00
Fawzi Mohamed
b8d99af6fd qmljs: fix arrow function reformatting
This is mainly just making sure that token that are "empty" are really
empty (to avoid writing them out in the reformatter), but still
contain the correct location (for error messages using for example
firstSourceLocation()).

Introduce a SourceLocation::zeroLength() method to make this change
simpler to do.

QtCreator does not run qlalr automatically, so it is "polluted" by the
updated generated files.

Fixes: QTCREATORBUG-25198
Change-Id: I0ab19fb380ee3d9a7d9e05d104fe313468f52703
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-02-03 09:52:40 +00:00
David Schulz
785932f0f1 Debugger: improve std::unordered_map dumper for cdb
and fix dumper tests

Change-Id: I1debd25a835aba28d77e5605dc49a5ea01221995
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-01-29 10:59:23 +00:00
Fawzi Mohamed
c532076bfd qmljs: fix tst_dependencies
Fixed the dependencies test.

Now it makes sure that all dependencies are loaded before evaluating
the checks, otherwise a race condition in the link process (QTCREATORBUG-25240) might give problems.
This requires running the event loop to ensure that the invokeMethod
in PluginDumper::loadPluginTypes creates the futures in the model
manager.

Change-Id: I4c0dd5cc948917e2a74fd46c3b66ee3bb5370da4
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-01-20 08:12:21 +00:00
Fawzi Mohamed
d4d5d5db11 qmljs: fix tst_dependencies imports
update imports of tst_dependencies to newer version (for Qt 5.15)

Change-Id: I095200a2fe54a059cd2d69c76b6da08ab8e596a5
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-01-18 14:49:57 +00:00
Eike Ziller
16d25a3cc8 Merge remote-tracking branch 'origin/4.14'
Conflicts:
	src/plugins/qmldesigner/assetexporterplugin/componentexporter.cpp

Change-Id: If742bcd843cf75cf55e07b489ecb7211f0cd9058
2021-01-18 11:50:32 +01:00
Fawzi Mohamed
45bdb39c6b qmljs: fix tst_importcheck
Mainly update import lists for Qt5.15 and ensure load is complete
before comparing.

Change-Id: I954cc4806d49d1a466f5e558b836ce49eb3693b0
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-01-15 13:55:33 +00:00
Ulf Hermann
663a12e00f Tracing: Fix flamegraph view test
QQC2's scroll view does not allow clicking through the scroll bars even
if they are invisible. That's a shame, but we're not going to fix it in
QtCreator. Rather, choose locations to click on that are outside of the
scroll bars.

Also, wait for the window to be exposed before manipulating it.

Change-Id: I7d8de1a6be7dec88c5d0ac1707341b543e385a9e
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-01-15 13:05:59 +00:00
Christian Kandeler
a42d252054 SSH: Fix non-session based download operation
Apparently this one never worked, but as we don't use it in our own
code, that went unnoticed.

Fixes: QTCREATORBUG-25236
Change-Id: Ia013baf3ca2fd01cc14b72d9c6a5f73426539d00
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-01-15 10:41:32 +00:00
Christian Stenger
b4cc084a98 Utils: Add findAnyChild() to TypedTreeItem
Removes some static casts on the user side.

Change-Id: I0a9ae512f294c0e78e0a5890e557c483af86abfe
Reviewed-by: hjk <hjk@qt.io>
2021-01-08 05:58:54 +00:00
Eike Ziller
d95e1f940a Merge remote-tracking branch 'origin/4.14'
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri

Change-Id: I5b8d93f2f08b62626c3f3447728c64d198b601ff
2021-01-04 09:09:21 +01:00
Leander Schulten
771e269a3b QmlJs: Fix reformatter for template strings
Change-Id: Ie0b7909d634d1e2e735377b053f7a1c1c2518f78
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io>
2020-12-17 12:31:48 +00:00
Leander Schulten
7e526d9b05 QmlJs: Fix reformatter for arrow functions
Fixes: QTCREATORBUG-23019
Change-Id: I6c6bee7092cb12f225ad744df2b3834dfd4bbc8f
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io>
2020-12-17 12:17:20 +00:00
Eike Ziller
4bc2b4741d Merge remote-tracking branch 'origin/4.14'
Change-Id: I842a7c7358fd0ff6d85c151806e440043914e09a
2020-12-14 14:19:15 +01:00
David Schulz
93dd966ce2 CMake: add missing Utils dependency to extensionsystem test
Change-Id: I95a518e3ecb098bd39a06f921bfbeb1b6fb0126f
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-12-14 12:35:22 +00:00
hjk
c6ae5ab506 Debugger: Relax RValueReference test
Exact output depends on too many factors, just make sure the
base type is there.

Make LLDB+GCC on Linux pass.

Change-Id: I520a8367ab00ee95f87b5d4fb935f3ae21efd820
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-12-14 09:25:41 +00:00
hjk
50b2eb934f Debugger: Disable some static member tests for LLDB
LLDB does not report anything in that case nowadays. Which is actually fine.
Makes StaticMembersInLib and UndefinedStaticMembers pass.

Change-Id: I302ab702e5eacf89fcd08ea1935dbf43e5e56fa8
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-12-14 09:25:32 +00:00
hjk
77993e7b58 Debugger: Fix passing of extra parameters to LLDB dumper tests
As the others do. Fixes the WatchList dumper test.

Change-Id: Id1622f6d405e9e9c9b1f4b0124a7dca74f7e3019
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-12-14 08:55:33 +00:00
hjk
c4c55955e4 Debugger: Drop some too clever logic from ValuePattern matching
Change-Id: I6e1c89e3637e4408a23584bf71fcf8e2c4d29d7f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-12-11 12:48:23 +00:00
hjk
d4ed07eb87 Debugger: Change/improve LLDB display of enums in some cases
This fixes the Internal2, EnumFlags and EnumInClass tests on Linux.

The values lose now the previously hand-crafted Class:: prefixes,
but the context is clear from the type column, and it's what LLDB
developers (and potentially users) consider normal.

Change-Id: I09e41f7b4fb4f078ef3f535fe650d06e7c2a0331
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2020-12-11 11:37:11 +00:00
hjk
14035584d8 Debugger: Fix CharArray dumper and test for LLDB
Change-Id: If12936fa863633b1ca85e712f8395e8ab4a0d69c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-12-11 09:35:37 +00:00
hjk
5cf60fc38f Debugger: Fix LLDB message parsing in dumper tests
Was off by one, swallowing the first character of the message.

Change-Id: I736cadda2cb6d9e3703d276b631e574c498af874
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-12-11 09:35:01 +00:00
Christian Stenger
c6b23f903a Tests: Enable callgrindparser tests for cmake
Change-Id: I2fed0477e9d35e5978a728ed8fee40daca16b565
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-12-11 05:44:38 +00:00