Commit Graph

2492 Commits

Author SHA1 Message Date
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
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
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
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
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
hjk
1ff6f27286 Debugger: Replace CheckType in dumper test
Use a ValuePattern(.*) instead to specify an uninteresting/unchecked
value.

This allows using of TypePattern in the same check, allowing to fix
a part of CharArray test for LLDB.

Change-Id: I3b8b209318d663290c02ce466e2a198d3a66832f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-12-10 15:47:52 +00:00
Eike Ziller
1283b15117 Merge remote-tracking branch 'origin/4.14'
Conflicts:
	doc/qtdesignstudio/examples/loginui1/qtquickcontrols2.conf
	doc/qtdesignstudio/examples/loginui2/qtquickcontrols2.conf
	doc/qtdesignstudio/examples/loginui3/qtquickcontrols2.conf
	doc/qtdesignstudio/examples/loginui4/qtquickcontrols2.conf
	share/qtcreator/debugger/dumper.py
	share/qtcreator/debugger/qttypes.py

Change-Id: Id44a67cdeeb0889ff96eddcdf409d20ca7cbdd0b
2020-12-10 13:02:02 +01:00
hjk
eac85f8261 Debugger: Fix QObject property display with Qt 6
Task-number: QTCREATORBUG-24098
Change-Id: I6e1013fe39208ef6e9ba792e6b2fb745eb5e3108
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-12-10 09:59:58 +00:00
hjk
11d079a0fe Debugger: Partially fix QV4 dumper for Qt6
Just the 64 bit case, simple types.

Task-number: QTCREATORBUG-24098
Change-Id: If13e342c1fb419a026cdaa35b21483566e8494b7
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-12-10 09:32:13 +00:00
hjk
36c2e441ef Debugger: Adapt BoostSharedPointer dumper test to Qt 6
Use QList<QString> instead of QStringList for the test, the
actual dumper is unaffected.

Task-number: QTCREATORBUG-24098
Change-Id: Ibbdd9255add9744acc06144f8f8d5b34e42186c9
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-12-09 12:40:02 +00:00
hjk
c06d3e39d8 Debugger: Adapt dumper test for QTCREATORBUG-4904
Maps have changed.

Task-number: QTCREATORBUG-24098
Change-Id: I3a078e0168fb0e2a95d4c92fefc7c3cdeba9114f
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-12-09 08:51:00 +00:00
hjk
ce2e8bd2fb Debugger: Adapt QJson dumper to Qt6
Task-number: QTCREATORBUG-24098
Change-Id: I0bdfca1389763582072fd774b6288b9a855cf8cf
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-12-09 08:50:48 +00:00
hjk
e9ae81612f Debugger: Disable StaticMembersInLib dumper test for Qt 6
Both values used as test cases are gone.

Change-Id: I7f386a1ad1eccb0589b005d14090207cc518b6f3
Reviewed-by: hjk <hjk@qt.io>
2020-12-08 13:55:54 +00:00
Eike Ziller
3f0e7bcbe1 Merge remote-tracking branch 'origin/4.14'
Change-Id: I9d1931b7862f4541ac7a064ff987128afd835cbe
2020-12-07 12:29:44 +01:00
hjk
fba5effd41 Debugger: Adapt QMultiMap dumper test to Qt6
Task-number: QTCREATORBUG-24098
Change-Id: Iec811d90accd6fada7883e8bcb548ec0ab4c38f6
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-12-07 08:56:44 +00:00
hjk
aa9e1ec106 Debugger: Adapt QSet dumper and tests to Qt6
Task-number: QTCREATORBUG-24098
Change-Id: Ib9b2c53ee763871873f0cc3ad4f8ba0152999328
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-12-07 08:56:39 +00:00
Alessandro Portale
996ad4c8cb PluginManager test: Fix linkage for Qbs build system
Dependency on Utils is not exported by ExtensionSystem, therefore not
transitive.

Amends 41b73594ad

Change-Id: Iaa95ae16854cf760fdd32bc542297746b6351527
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-12-07 07:14:33 +00:00
hjk
d861778ff1 Debugger: Adapt Qt6 QVariant(QHostAddress) dumper test
Just brush over the differences between the versions, the actual
contents is ok.

Change-Id: I4fe8e1a0e87ab6c4157a048f215b8abb13887cd4
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-12-04 11:40:35 +00:00
Eike Ziller
41b73594ad Add API for saving settings with default value
We should never actually write default values into the settings, because

- if the default value changes in a later Qt Creator version, the new
  default should automatically take effect if the user didn't change the
  value
- it senselessly grows the settings file

Add a QtcSettings class that extends QSettings by a
"setValueWithDefault" method, which does not write default values to the
settings, and actually removes the settingskey if the user switches back
to the default.

Use it at the places where we already do this manually.

Task-number: QTCREATORBUG-24762
Change-Id: Ia76414cb21e8521f3aeed1e37b43ae4fb3393ea3
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-12-04 08:25:17 +00:00
hjk
e62d364d97 Debugger: Adapt QVariantMap dumper and test to Qt 6
Task-number: QTCREATORBUG-24098
Change-Id: I4e157a18ce5ff06a732fccbec1ec3d2ff507b961
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-12-03 15:22:24 +00:00